The main key to truly understanding God’s heart in Deuteronomy is to see that it is all about grace. There is no legalism here. When taken out of context, certain passages could seem to imply a legalistic mindset, but when read as a whole, Deuteronomy is the opposite of legalistic. God is a relational God; He does not want robots. He would rather have your heart, even if you are continuing to struggle with sin, than for you to be perfect and sinless but have your heart far from Him. In fact, this is one of the main issues that the later prophets have with the people. The prophets often quote from Deuteronomy, noting that the people do many of the right things (although they sin terribly too), but that their hearts are far from God. Jesus, when asked about the two greatest commandments, first quotes from Deuteronomy about loving God (Matt. 22:34–40)! Of course, this love implies covenantal commitment, and actions that demonstrate that love, but it starts with love! And this love then leads to love for other people.
God does not only love Israel, but He loves all people. This is a reference to the aspect of God’s choice in the covenant, in that God had to choose someone through whom to give His message of grace to the world. And God did not choose them because of their righteousness (Deut. 9:4–12). God is certainly not limited to Israel, because He works through many other non-Israelite people throughout the Bible to share His grace (think of Balaam, Rahab, and others). But that choice by God gives a greater responsibility to Israel to pass on this love to other people. Here in Deuteronomy 10, God calls the people to care for the fatherless, widows, and foreigners, because this is what God does (vv. 18, 19). God provides for them, and because He loves us and loves them, and we love Him, we are also to love them. In addition, we were foreigners also, and this should be the reason that we understand and sympathize and bring love and help. We were adopted into God’s family, and so we have the privilege of sharing that joy with others and inviting others in as well. This says a lot about how we are still called to right the social wrongs around us today. We are to be ministers of God’s love to any and all who need it, especially to the most vulnerable and needy. This passage says nothing about ascertaining their motives, but only that we are to love them as God has loved us.