Well... I can't tell you why you have this intrusive thought.

Current research regarding the workings of the human brain tell us that much more of who we are, & what we do, is controlled by areas of the brain to which we have no conscious access than we would typically imagine.

So perhaps the answer is... there is material (memories, etc.) stored in non-conscious areas of your brain that is causing you to have the intrusive thoughts you're struggling with.
The important thing is... what can you do about them? And, as *Laurie* wrote, it's best to simply observe or just notice them... to not become attached... & to allow them to simply float away. There is a practice referred to as "compassionate abiding" which is useful in this regard. Here's a link to a description of the practice:
https://mindsetdoc.wordpress.com/201...e-abiding-101/
May it be of benefit.