Hello and welcome!
There are 1,050 commands in the NT, so why is legalistic to obey the 613 commands in the OT, but not the commands in the NT? Was Jesus legalistic when he lived in complete obedience to the Mosaic law? Legalism is not in regard to whether you think one or many laws should be obeyed, but rather it is in regard to the manner in which you obey them. In other words, do you obey God's commands because of what you will be owed in return for your obedience in order to glory yourself or because you will be owed your justification? Or do you obey God's commands in order to glory God, because you want to demonstrate your faith in Him to lead you in how to rightly live that His commands are for your own good (Deuteronomy 10:13), and because that want demonstrate you love to God (John 14:15). Do you follow the law according to the letter or do you seek to understand the deeper spiritual principles behind the law of which the laws are just examples (Romans 7:14)?
The problem is Romans 9:30-32 was not that Israel failed to obtain righteousness because they obeyed what God told them to and God gave them faulty commands, but rather the problem was that they pursued God's law legalistically as through righteousness were by works instead of pursuing God's law spiritually as though righteousness were by faith. A relationship with Messiah is the goal of the law (Romans 10:4) so obedience to the law has always been about developing a relationship with God based on faith and love, while God has always disdained it when His people honored Him with their lips while their hearts were far from Him (Isaiah 29:13, Mark 7:6-8). God has always been primarily concerned with where our heart it at, so what good is it for someone to outwardly obey God's law and make and offering if they aren't repentant in their heart and they don't draw close to God?
According to Romans 4:1-8, Abraham and David were justified by faith, and the one and only way to become justified is by faith, so Moses was justified by faith apart from the law, which means that the law was never given nor needed for that purpose. In other words, the law was not given as instructions for what to do in order to become righteous, but rather it was given to instruct those that God had declared righteous by faith how to do what is righteous by faith. So if you were trying to become justified by obeying the law, then you would be perverting it into legalism, but it does not follow that because you shouldn't obey the law that purpose for which it was never intended that therefore we shouldn't obey it for the reasons for which it was given.
According to Deuteronomy 6:20-25, obedience to the Mosaic law is about demonstrating faith in God to defeat Pharaoh, to lead them out of Egypt, to give them the land that He sword to their fathers, that His commands are for our own good, in God to preserve us. It is because we trust God that we are careful to obey all of His instructions. Hebrews 11 is full of examples of people who demonstrated their faith by obeying God's instructions.
A theme of Exodus is about God revealing who He is through His actions as the God who took them out of Egypt and through His law as being merciful and gracious, slow to anger, and abounding in steadfast love and faithfulness, keeping steadfast love for thousands, forgiving iniquity and transgression and sin, but who will by no means clear the guilty, visiting the iniquity of the fathers on the children and the children's children, to the third and the fourth generation (Exodus 34:6-7). Obedience to the law is also about revealing who God is to the nations (Deuteronomy 4:5-8). The law was given to reveal how to do what is holy, righteous, and good (Romans 7:12) and to thereby instruct us about God's holiness, righteousness, and goodness. However, the law was also given to reveal what sin is, how God would deal with sin, and to point us to the one who could redeem us from sin. Jesus said that if we love him, then keep his commands, so obedience to God's law is about demonstrating our love for Him. Jesus summarized the law as being instructions for how to love God and our neighbor (Matthew 22:36-40). It's about entering into life that is life (Matthew 19:17), about following the good way where we will find rest for our souls (Jeremiah 6:16-19), and about delighting in God (Psalms 1:1-2, Romans 7:22).
A relationship with Messiah based on faith is the goal of the law (Romans 10:4), so if you read the law and miss that it is about teaching us about Messiah, then you've missed the whole point. Prior to Paul's conversion, he had been keeping the law without its focus on growing in a relationship with Messiah based on faith, so he had been missing the whole point, which is why he considered it to be rubbish (Philippians 3:8).
The law is the way (Jeremiah 6:16-19), the truth (Psalms 119:142), and the life (Deuteronomy 30:15-20, Matthew 19:17), Jesus is the way, the truth, and the life (John 14:6), the law is God's word, and Messiah is God's word made flesh. The Spirit has the role of leading us in obedience to God's law (Ezekiel 36:26-27), of leading us in truth (John 16:13), and God's law is truth.
If you're interested into going through a verse-by-verse study on Romans, Galatians, of on Finding Messiah in the Torah, then we have it posted online, as well as also sermons and articles:
http://rabbiyeshua.com/