So you already know that he's a good guy. Fair enough.
Thing is, he waits so long until the last minute to reveal this that when I first read this manga, I actually thought him being secretly good was a red herring and that he was actually genuinely loyal to Aizen the whole time. Literally four pages after that thought of mine, he skewers Aizen.
Did it ever occur to Gin to snitch on Aizen at some point over the past century? No.
Did he skewer Aizen when he was completely surrounded by the Shinigami at the climax of the Soul Society Arc? No.
Did he skewer Aizen during the latter's 12v1 fight against most of the Shinigami Captains + Vizards? No.
Did he skewer Aizen while he was fighting Yamamoto? No.
Did he kill Wonderweiss to allow Yamamoto to focus on Aizen? No.
Did he skewer Aizen while he was fighting Isshin, Urahara and Yoruichi? No, he actually fought Ichigo and prevented him from getting to Aizen while he was fighting in a 3v1 disadvantage.
No, he doesn't do any of that. He stabs Aizen after the latter has fused with the Hōgyoku (nonsense plot mcguffin that makes Aizen a god or something), after Aizen has already won and beaten literally everybody.
How was Gin able to skewer him? Because he knew how to bypass Aizen's utterly hax
Shikai ability that allows him to control all the senses of anybody and everybody who so much as looks at his
Zanpakutō sword.
How did Gin figure out how to bypass Aizen's trump card ability?
Now here is the best part.
You ready?
He didn't figure it out.
Aizen feckin told him how to bypass it in a flashback.
Aizen, the oh so smart, ultra giga brained mastermind manipulator known for his paranoia and his disdain for any concept so much as resembling trust or friendship, told Gin how to bypass his sensory manipulation ability.
You wanna know what Aizen says after his magic plot mcguffin ability near instantly revives him?
"I already knew all along that you were going to betray me Gin!"
Brilliant. Absolutely brilliant.
He informed the bloke that he supposedly knew wanted to kill him, on how to bypass his greatest ability.
The smartest man in the manga folk. It didn't occur to Aizen to just lie to Gin and it didn't occur to Gin that Aizen could just simply lie.
These are what Titty Kubo thinks are intelligent, scheming characters.