Being “religious” carries some weight with God, doesn’t it? Unfortunately, not a bit. Not even a little. Being Jewish or Baptist or Muslim doesn’t do it.
There is nothing we can do, even being religious, to get in right standing with God. Out of sheer generosity God put us in right standing with himself. A pure gift. He got us out of the mess we’re in and restored us to where he always wanted us to be. And he did it by means of King Jesus, the Messiah.
Then what becomes of our boasting? It is excluded. By what kind of law? By a law of works? No, but by the law of faith. For we hold that one is justified by faith apart from works of the law. Or is God the God of Jews only? Is he not the God of Gentiles also? Yes, of Gentiles also, since God is one—who will justify the circumcised by faith and the uncircumcised through faith. Do we then overthrow the law by this faith? By no means! On the contrary, we uphold the law. 
(Romans 3:27-31 ESV)
Because of his Jewish readers, Paul wanted to say more about the relationship of the Gospel to the Law. The doctrine of justification by faith is not against the Law, because it establishes the Law.
- God obeyed His own Law in working out the plan of salvation.
- Jesus in His life and death completely fulfilled the demands of the Law.
- God does not have two ways of salvation, one for the Jews and one for the Gentiles; for He is one God.
God is consistent with His own nature and His own Law. If salvation is through the Law, then men can boast; but the principle of faith makes it impossible for men to boast. The swimmer, when he is saved from drowning, does not brag because he trusted the lifeguard. What else could he do? When a believing sinner is justified by faith, he cannot boast of his faith, but he can boast in a wonderful Savior. 
 The Holy Bible: English Standard Version. (2016). (Ro 3:27–31). Wheaton, IL: Crossway Bibles.
 Wiersbe, W. W. (1996). The Bible exposition commentary (Vol. 1, p. 524). Wheaton, IL: Victor Books.