Deut 25:6 And it shall be, that the firstborn which she beareth shall succeed in the name of his brother which is dead, that his name be not put out of Israel.
It ancient times, it was very important that people pass on their name to succeeding generations. In Israel it was a way to have part in the future inheritance God’s promised to them.
With that in mind, the custom of Levirate marriage here does not seem as strange. A brother would marry his deceased brother’s wife if they had no male heir. The purpose was to keep his brother’s name alive.
Knowing the tendency of men to care more about their own name than their brother’s name, God instituted a punishment of social humiliation for those who refused to build their brother’s name.
It should be a shame for us as well when our brother’s name is not built up. It is our responsibility to look out for his name and to do all in our power to encourage and make others around us a success.