There was never one definitive reason why, it was a slow process, it wasn't some 'sudden realization'. I dunno if I even really believed in god, he was just something everyone else believed in and I just went along with it.
When the realization was broken to me as a kid there was no father christmas, or tooth fairy, or easter bunny, thats when the whole idea of make believe characters I was told as a child were all fake, including when the school use to read us bible stories (it was the 80's and most non-private schools had it mandatory then). When stuff you use to believe was real suddenly stops being so, then everything else you were told equally as made up falls into that ether of make believe.
But unlike father christmas and similar, things like jesus and god were preached by full grown adults and seeing them, I questioned if maybe god is just separate from those childish make believe characters. Thats when the contradictions come into it, like god being all loving but killing people because they don't follow him or all knowing despite not knowing half the shit going on in his own book and then killing or cursing people who disobey him.
When your a child and believing in make believe characters, it gives you comfort against the harsh real world, but you grow up from it. God is just a coping mechanism for people who need that comfort blanket their whole lives unable to face the harsh realities of life and death. God is the make believe character adults keep believing in to shroud themselves from the harsh facts of reality.
So really, I guess the first time I questioned god being real, was when I stopped believing in make believe characters.