One of the Sages remarked that a person who takes pleasure in good food on a feast day is often enjoying his belly and not the holiness of the occasion.
Thus the feeling of joy in some outer spiritual circumstance will have its parallel in a physical source.
Because the physical sensation can be the same for both, there is a lot of room for imagination and error.
A person can imagine he is on some high plane of sanctity and actually just be puffed up with pride.
The sensation of spiritual achievement may very well be no more than an enhanced appreciation of one's ego.
To be sure, there are instances when the distinction is so grossly obvious that a person has to be cunningly able to deceive himself to get away with the fraud.
But there are also cases when the differences are very subtle indeed, and there are no objective standards to measure oneself by.
The purely subjective pleasure stands by itself in the midst of a question: Where am I? What is the source of my joy?
Again, let us take as an illustration the case of a man studying Torah.
He becomes elated at having found something new and interesting, a "chidush" (innovation).
And indeed the Torah may very well have revealed something marvelous to him and his joy may be a genuine intellectual elation unrelated to his ego.
Or it may be a feeling of exultation at having gotten the better of someone else, of showing himself to be more clever, more successful than others.
That is to say, it can be a joy of spiritual experience or it can be a joy of the shell.
This person can continue to study Torah and keep enjoying the occupation with Holy Scripture while all the time be involved in idolatrous worship of himself.
He can even be immersed in Torah in order to maintain a barrier between himself and people, because he dislikes people.
Perhaps the more he shrinks from the people around him, the more intensely he will bury himself in study.
Hatred of others can hardly be considered a basis for love of God and His Torah.
–Rabbi Adin Steinsaltz
From "Overcoming the Obstacles of Lower Unity" in In the Beginning by Rabbi Adin Steinsaltz