Is the law sin? Paul says as a Jew, “I had not known sin except by the the law”. This is why God said to Israel that it would be more tolerable for Sodom and Gomorrah, who had not the law, in the day of Judgement, than for them who had it. It simply aggravated their condemnation as it pointed them to Jesus whom they rejected and gave them a greater knowledge of the more excellent way of God. Jesus said to Pilate, those who delivered me to you have the greater condemnation.
In like manner, those who have the gospel and receive it not will have the greater condemnation.