Paul does not always write in a way that people can understand at once. He's referring to the Jews. The Torah itself says it's for Israel. Indeed, Gentiles were forbidden from celebrating the Passover unless they were circumcised. Compare to:
Romans 2:14 For when the Gentiles, which have not the law, do by nature the things contained in the law, these, having not the law, are a law unto themselves:
15 Which shew the work of the law written in their hearts, their conscience also bearing witness, and their thoughts the mean while accusing or else excusing one another. . .
In other words, they keep the spiritual law which Israel had rejected. The hearts of Israel were hard and they did not want to hear the Voice of God. Then the Law of Moses was given to them. They received human words, the written Torah, because they did not want to hear the Voice of God.
Ask a Rabbi if you don't believe me. Gentiles are not expected to keep the Law. Never were. Tell me how someone in Australia three thousand years ago could keep all the laws of Moses. They'd never heard of Moses or the Temple, let alone be able to offer sacrifices there or be expected to know when to observe the Jewish Feasts. They could however have the "work of the law written in the hearts."
The law of the Lord is something that is eternally set in the heavens; and it exists as a standard even when it is not known to the person violating it...sin is not imputed where there is no law...however, sin is still a reality where there is no law, and the wages of sin is death...so death reigned from Adam to Moses.
Galatians 3:23 is clear, that those who do not have faith are kept under the law; and even if they are not aware of what the law says, they are subject to the law written in their conscience (as well as the law of Moses); and when they violate it, they will be held accountable and judged according to the law written in their conscience.
And also, if anyone today desires to earn their salvation, attaining to it or maintaining it through their works...then they are subject to the law of God and must keep every precept in perfect order from the moment of conception even into eternity (see Galatians 3:10, James 2:10, Matthew 5:48). But if anyone receives Christ as Lord and Saviour, they are not under the law, are delivered from the law, and are dead to the law (Romans 6:14, Romans 7:4, Romans 7:6, Galatians 2:19): the law no longer has the power to condemn them from the outside; for they are forgiven of all their sin(s). However, it still governs us from the inside.
For the unbeliever, the law condemns them from the outside, as the standard that declares the righteousness of the Lord; because they are not governed by it from the inside: and are therefore violators of its holy standard.
The law is the standard that reveals sin. And therefore if Gentiles are not under the law, they cannot sin...for they are not violating any standard set before them. However, because they are under the law, the law serves as a standard that is in contrast to their unholy way of living: and in violating the law they sin (in sinning they also violate the law): because sin is the transgressing of the law.
Therefore if Gentiles are not under the law, there is no standard for them to violate and they do not sin.
This is why I believe that Gentiles are under the law; because they do sin: and this sin is the transgression of the law of the Lord (1 John 3:4).