Willingly consenting to lustful thoughts with full knowledge and full consent of the will is mortally sinful regardless of if it is heterosexual or homosexual. All three conditions must be present for both.
According to my understanding, homosexual tendency is not a sin while homosexual activities are grave sins. So suppose a Catholic man does not undergo homosexual activities but feels a strong attachment to other men, and has sexual fantasy with men (which in some occasions are close to sadism or are beyond reason) before he sleeps. Is this also a kind of adultery?
Again, depends on if full knowledge and full consent are present. Also, they need to be present at the same time. If someone is daydreaming and has full consent, but doesn’t realize that it is wrong because they are daydreaming, it is not mortal. When all three conditions for mortal sin are present at the same, mortal sin exists. If even one of the three is missing, then it does not exist. Most of the time lustful thoughts are not intentional. St. Alphonsus Ligouri, the Doctor of Moral Theology, said that we can be sure that sin does not exist if we pray during the moment of temptation.
If a Catholic tries to control sexual fantasies but fails, is it a must that he go to Hell even after Baptism?
How to eradicate all thoughts about sex?
All mortal sins can be forgiven in the confessional.
It is next to impossible to completely “eradicate all thoughts about sex”. You simply pray to God to take the thoughts away and do not willingly indulge in them.
Last week, my school invited a doctor to have a talk during an assembly about how to ‘transform gay men into straight guys’, and the nearly brainwashing talk sparked fierce debates and confrontations between many students and Religious Studies teachers. That’s why I have the above questions in mind.
Any official Catholic teachings on homosexuality and the above matters?
There is no official Catholic teaching on that type of therapy. The Church does not know the cause of homosexuality, and recognizes that any number of factors could be at work.
Some people around here think that the gay conversion therapies work. I am of the belief that they don’t, because the only studies that support them are not the most credible. (I will be challenged on this on CAF, but it is true…) The Church does not require gay people to try to change their orientation. She requires that they live in chastity according to their state in life.