Something happened to me today, that made me feel both very ashamed and frightened at the same time.
You met an attractive woman. Your brain took to task the idea, make her mine. It returned with the method by which this could be achieved. This is how we work. Anything of interest to us that appears in our path, our brains will provide solutions to it.
Imagine if it was a guy with a gun? Or a car travelling towards you at great speed? Your brain has only a short time to assess the situation and come up with actions to save your life. It is no different, and does not reflect on your morals or who you are.
I heard a story about a man who was always optimistic in life. He just did what his brain came up with, as it always seemed a good idea. Later in life he got depressed and was prescribed some anti-depresants. A side effect of these drugs was often suicidal thoughts. Now for this guy, he did not separate the ideas that popped up from who he was. Not good. He had not been aware of thoughts are not who he is, it is what you choose that defines you, and what you dwell on.
You have within all the evil and desires that rule in every person. Given the right situations this junk will just come up.
Dismissing it for what it is, and putting it into context helps your brain deal with it. If our brains did not do this all the time we would find it hard to empathise or understand the thoughts occuring in others. So this process will always happen throughout your life.