From my experience with intrusive thoughts, the kind that go against what we value, they can cause so much anxiety, sadness and guilt. You may be feeling depressed because the thoughts that bother you so much are wearing you down. That's what happened to me. I bought into the thoughts and assumed that they had some value about who I am and because of that, buying into them, I'd taken ownership of them and they were no longer chemical reactions but something that I needed to be concerned about, to worry about, to fix. I grasped them so strongly in my hand and wouldn't let go. The ironic truth is that those thoughts are like hot coals that we hold onto. We try to fix them when what we really need to do is let go of them. Why would one purposefully hold onto something that hurts them so much?
You are giving energy and power to thoughts that occurred in the past and projecting how they may impact you later, the future. All we have is the present, the now.
OCD thrives and lives in the past and future but can be easily squashed in the present. I ran across the following quote by Eckhart Tolle that sums this up quite well. "Just as the moon has no light of it's own, but can only reflect the light of the sun, so are past and future only pale reflections of the light, power and reality of the eternal present. Their reality is 'borrowed' from the Now."
Being depressed feeds on how we perceive what happened or may not have happened in the past and what may or may not occur in the future. Typically through the lens of a cognitive distortion that makes us feel even worse and distorts our memory of events into monsters that they are not and never were.
There have been times when an intrusive thought became an OCD obsession that pushed me into a deep depression. For that to happen I bought into the thoughts as real and worthy of my attention and my thinking. We are taught to think in terms of future and past and that our thoughts represent us and our ego; we have to unlearn this to get better because it was a lie in the first place.