He was paying Naomi for the land, she did not inherit it, but legally possessed it and could sell portions of it. Hooking Ruth up with Boaz was Naomi's way of rewarding her for her devotion and kindness. Considering the land was originally sold because of famine, it's debatable whether anyone managed to make a profit off of it while Elimelech's family was away.
This Commentary does an excellent job of answering your question, I'll attempt to summarize it below:
When land was sold in Israel, it was more of a lease or rental agreement since all land reverted to the original owner at the Jubilee, every 50th year. Elimelech "sold" his land, but did not lose his title to it (essentially what he sold were the profits of the yearly produce until the year of jubilee). Widows were not listed in the line of inheritance (see Numbers 27:8-11), when Elimelech died, the title would have passed to his sons, but since they had also died Naomi was essentially left childless. Therefore, the law in Deuteronomy 25:5-9 applied.
However, Naomi would have retained possession of her dead husbands land, in which Ruth, as the widow of Mahlon, also had a share. The law relating to the inheritance of the landed property of Israelites who died childless did not determine the time when such a possession should pass to the relatives of the deceased, whether immediately after the death of the owner, or not until after the death of the widow who was left behind.
The transaction with Boaz gave Naomi money for her support (Leviticus 25:25), as well as a future heir to inherit Elimelech's land, born to Ruth, her beloved daughter-in-law whom Boaz was legally obligated to marry after the transaction.