The law addresses those who are under the law: under its authority, obliged to listen to it and keep it. The apostle doesn't just mean Jews, he means everyone, because he has already proved that Gentiles – who before the time of Christ had not received the Scriptures – had the law of God written in their hearts.
These standards are given so that we may say, ‘I have fallen short. I am a sinner. I have not kept these laws. I am far away from God.’ It is it given ‘that every mouth may be stopped and all the world may become guilty before God.’ The purpose of the law is to end discussion so that we don't say to each other, ‘I am fit to stand before God. I have some good things about me. I have this and that excuse for behaving the way I do. I don't think that is so bad. I think that is all right.’ Every mouth is stopped, and all excuses and all self-justification is silenced. The law is given to convince us that we are all sinners. God has said it in his law, so we know it is wrong. He has given it in his word. He has written it in our hearts, in our consciences. It's not up for discussion. Is it right to be gay? Is homosexual practice right or wrong? Every mouth is stopped by the word of God. This is the standard. These things are wrong and evil: no discussion. And that is what we will be judged by. So that is the primary purpose of the law, to lay down and expose human guilt.
Not until a soul feels their guilt are they ready to hear the good news of the gospel. The gospel preacher preaches the law also, so that his hearers understand that without grace they are condemned and without hope. Only when they see this will they let go of their imagined righteousness and embrace Christ. The Epistle to the Romans presents truth in a logical order which is highly instructive to anyone wishing to communicate God’s message to this lost world.