VaYikra (Leviticus) 19:9-10
“Sefer HaChinuch in his treatment of the mitzvah of Pe’ah does not describe the mitzvah’s objective as social justice. Instead, he stresses the impact of the mitzvah on the owner of the field. Apparently, according to Sefer HaChinuch, the fundamental purpose of the mitzvah – on a Torah level – is not to provide support for the poor. The fundamental objective of the mitzvah is expressed in its impact on the owner of the field. Apparently, the mitzvah is designed to discourage greed.” (Emphasis supplied)
“The Talmud Yerushalmi notes that both the passages in Sefer VaYikra and those in Sefer Devarim direct Bnai Yisrael to leave Leket and the other agricultural gifts to the poor. However, the two sets of passages describe the beneficiaries differently. The passages in Sefer VaYika direct Bnai Yisrael to “leave them for the poor person and the convert”. Two beneficiary groups are identified – the poor and the convert. In Sefer Devarim the Torah tells us that “it shall be for the convert, for the orphan, and for the widow”. In this passage three beneficiary groups are identified.
The Talmud Yerushalmi explains that Bait Hillel maintains that the maximum number of sheaves or ears that must be left for the poor corresponds with the number of beneficiary groups identified in Sefer VaYikra – the poor and convert. Therefore, only two or less ears or sheaves dropped or forgotten in a single spot are left for the needy. If more than two ears are dropped or sheaves forgotten, the owner may collect them. Bait Shamai bases its position of the number of beneficiary groups identified in Sefer Deravim. That passage identifies three groups – the convert, orphan, and widow. Based upon this passage, even three dropped ears or forgotten sheaves must be abandoned and only four or more may be collected by the owner.” https://www.ou.org/torah/parsha/rabbi-fox-on-parsha/moral_lessons_derived_from_the_laws_of_leket/
As I read the two passages (VaYikra 19.9-10, and Devarim 24.19) and both articles linked herein, I think that the Torah is teaching us important lessons of the responsibility of the land-owner towards the poor and the stranger – to abstain from greed or stinginess – look at the example of Boaz towards Ruth – 2.8-17 (here, Ruth was both a widow and a convert).
it’s secondary lesson, by listing the stranger first in Devarim 24.19 is the responsibility of the stranger “to look out for” the fatherless and the widow (the poor of VaYikra 19.9-10) as VaYikra 19.9-10 lists the poor before the stranger and therefore the fatherless and the widow’s right to pe’ah and leket etc. come before that of the stranger since the stranger is in a better social position than that of the fatherless and the widow!