A person going to temple gets an irresistible sense of idea to abuse God which can't be resisted. Likely diagnosis is :
Irresistible thought to abuse the God suggests the diagnosis of obsession of thoughts.
Mania
Obsessive - Compulsive disorder
Schizophrenia
Delusion