Some of the staunchest preaching against immorality has been carried on by legalists, who ultimately get discovered and exposed for their own affairs. They both have sinned.
Sin is sin.
God sees them both. They got to that judgment by not being found in the Book of Life. But the degree of the severity of their judgment is based on their works. It waddles, swims and quacks. The legalist and heathen are on equal footing in God's sight.