The shell around the seed has to break before the tree can emerge. You have to get rid of the ego before you gain knowledge.
It is no use pouring water into a dirty bucket; the water will get dirty. In the same way, if you maintain the ego while doing sadhana, you cannot take total refuge in God. You cannot experience and enjoy the benefits of sadhana.
How can someone who can't even swim across a small river swim across the ocean? It is not possible to reach the supreme state without removing all small selfishness.
The sun gets concealed by the clouds. In a like manner, God is concealed by our ego and vasanas (latent tendencies). He becomes visible when the dirt of those tendencies is removed.