When one is deeply concentrating his mind on the great ideal of Yoga to the exclusion of every other thought, he has attained the highest mental purity, and any other extraneous thought would be a distraction from it, a deviation from the highest norm of psychological purity. But, this is the final definition of psychological purity. There are lesser definitions of it, all of which are equally important. Any contemplation mentally of an object or a situation, which is likely to draw the energy of the mind in a direction other than that of Yoga, may be regarded as an impure thought. Usually, people regard mental impurity as a thought of desire.
Any desire is regarded as mental impurity, generally speaking.
But, this is a sweeping statement, and it is difficult to understand its real significance. Because, there are desires and desires of umpteen types. Some of them may be positive and helpful, some of them may be of a different nature. Here, one's discretion has to be used with an independent judgement of the whole circumstance, or the guidance of a teacher has to be obtained, where one's own judgement is very difficult to form. However, in essence, we may say that mental purity is that condition of the mind where it is able to associate itself only with those conditions of living, which positively pave the way to the realisation of the goal gradually, step by step, stage by stage.