Most of us fail and most of us make foolish or mistaken choices. The Bible is full of humans with all their failures and even the best of them such as Abraham make grave, often foolish mistakes. So did Elijah, so did David and so did Solomon.
Elimelech also made mistakes but his were in direct denial of the meaning of the name he was given. The intentions of the author of the Book of Ruth is to show, against a background of the time of the Judges, how God still dealt both in discipline and in mercy and grace, with His people. "El" means "God" and "Eli" means, "my God". Melech, of course, means "king" so Elimelech means "My God is King".
If God had been truly his king, Elimelech would perhaps not have acted as he did. He lived in Bethlehem in the Yehudah (Judah) region. It was a place whose name meant, "House of Bread," (Beit = house, Lehem = bread) and it was in Judah, which was the leading and royal tribe of the people of Israel. A famine in the House of Bread seems to be a contradiction in terms. But if God had allowed the famine, because of the disobedience of His people, then we see why it could have happened. Elimelech's name implies some sort of relationship between him and God. Could he have warned his fellow citizens? Could he have interceded with God on their behalf? No doubt he could, but he did not.
'Naomi' also is a special name, it means 'pleasant' or 'sweetness' and, maybe, says something of her character before her husband took her off to Moab where, after her return, she told her fellow citizens that “The Almighty has dealt bitterly with me.” So she asked to be called 'Marah', "bitter'.
The father's decision to emigrate away to escape the famine resulted in his death and the death of his sons. The sons names mean 'pining' and sickness'. This tells us something of the weakness in the family resulting from Elimelech's failure to live up to his name. They died, and their young wives were left widows.
One of the daughters in law went back to her people as Naomi urged. The other, Ruth, whose name may mean "beauty" or "appearance" or "satisfied", stayed with her mother in law. Her speech to Naomi is among the most touching of human utterances full of faith and love, of devotion and tenderness. “Entreat me not to leave thee, or to return from following after thee: For whither thou goest, I will go, and where thou lodgest, I will lodge. Thy people shall be my people, and thy God my God. Where thou diest, will I die and there will I be buried.” (Ruth 1:16,17.)
On returning to Bethlehem they find it once more to be what it was designed and named to be, The House of Bread. Naomi there calls herself Marah, "bitterness" for the reason already stated. Ruth, at her direction goes out, in the barley harvest and the following wheat harvest, to glean. Once this was always the privilege of the poor and a sack of corn was often proudly displayed in the corner of a room in a labourer's cottage.
Boaz is yet to be one of a pair with Ruth but he notes her diligence and rewards it by instructing his men to leave, “handfuls on purpose” for her. Naomi reveals that this man is a 'goel'. That is, a 'kinsman', who has the responsibility for redeeming a relative who is in debt or enslaved. He also has the responsibility of marrying a widow to raise up a son in the name of the dead.
Boaz, after negotiations with a closer relative, marries Ruth and they have a son named Obed (meaning: worker) who is looked after by Naomi. There are several pairings here. Boaz whose name means, "In Him is Strength" is now responsible and cares for the two women. Ruth has a child who is called 'servant' for that is the meaning of "Obed". Much later Obed becomes the father of Jesse and he is the father of David the King.
Elimelech lost, as it were the privilege of having God as his King through his unfaithfulness. David is the King after God's own heart and so the story ends happily and with a certain symmetry. Boaz gives of his strength and his wealth to care for the two women and that results in service then Jesse, which means, "wealth". Finally David who is called "beloved", and is King.
So, even during the time of uncertainty and even anarchy which characterized the time of the Judges, the hope of a king, which was lost in Elimelech was restored through Boaz and Ruth. The character of the time of the Judges is three times described in the Book of Judges. “In those days there was no king in Israel. Every man did that which was right in his own eyes.” (17:6. 19:1. 21:25.)