Little children, let no man deceive you. He that does justice is just, even as he is just. [1 John 3:7]
No mere legal fiction makes a man holy; it's the one who actually does what is right that may be called righteous.
And it is only the righteous who will see God.
Lord, who shall dwell in your tabernacle? Or who shall rest in your holy hill? He that walks without blemish, and works justice. [Ps. 15:2]