Trying to find causes of everything
It's correct that these things should not be contemplated due to their ability to destabilize the mind, making it less suitable for meditation practice. Thinking about such topics is useless from a Buddhist point of view.
Just be mindful of the habit and the thoughts when they arise. With time and practice they will subside.