Desire is the emotion of longing or hoping for a person, object, or outcome. The same sense is expressed by words such as "craving". When a person desires something or someone, their sense of longing is excited by the enjoyment or the thought of the item or person, and they want to take actions to obtain their goal.
Desire itself can never be justified unless it is approved by pure religion which is the message of The Creator, Allah, to make our life on the right path. Unguided desires can lead to disastrous results. The examples of such unguided and wrong desires are so many. There are people who have desire for animals etc. This means that desire itself can never be justified unless it is approved by true religion.
Such desires need to be controlled by the intellect which guided by the word of Allah (SWT). The person should always remember Allah and seek His help in tackling evil desires.
Repeating Estighfaar and Salawaat is very useful.
Controlling bad desires is always possible through strong will power and strengthening the intellectual qualities and remembering the results of the good deeds and bad deeds. Those who use their senses and intellect, see the results before it happens as life has millions of similar examples of people who followed their desires and landed in disastrous results and pious people who controlled their desires and got high degrees of success.
Dreams are not intentional acts, so , there is no punishment for just dreaming.