A 40 year old man had thyroidectomy 2 years ago and now he has decrease in sexual excitement. Does it has somerhing to do with his operation?

Maybe. With the removal of or part of the thyroid gland, can lead to a form of hypothyroidism. A person can present with fatigue, depression and many other symptoms. These symptoms may indirectly cause a decreased sex drive. Please consult your doctor to properly diagnose the issue and proceed towards proper therapy..Simple lab tests will determine if the thyroid issues are contributing.
Possibly. Loss of sexual interest or libido can be related to an imbalance in one's thyroid hormone level. If one has had a thyroidectomy, then it is an imbalance in the thyroid replacement dose. Best to see your family doctor, internist, or endocrinologist to check the hormone levels.