With the Soul King finally appearing in Bleach: Thousand-Year Blood War, there has been a lot of talk about Sosuke Aizen and his goals. In the original Bleach anime, Aizen turned out to be the biggest antagonist after he tricked the entire Gotei 13 in an attempt to create the King Key to enter the Soul King Palace.
While a lot of focus was on Aizen, several fans were unaware of the reasons behind his actions. He stole the Hogyoku from Rukia's body by pretending to be the Central 46 and orchestrating her execution. He did so to create an army of Arrancar in Hueco Mundo to attack the Karakura town and fuse with the Hogyoku.
Bleach: Why did Aizen betray the Soul Society?
Sosuke Aizen betrayed the Soul Society to gain power and overthrow the Soul King. He was tired of obeying the Soul King and considered himself a higher being capable of making decisions and creating a world out of his own vision.
His hate for the Soul King was evident from his argument with Kisuke Urahara during his fight against Ichigo as he was seen shouting at the former Squad 12 captain.
Aizen despised the Soul King over his existence, in which the noble families (except for the Shiba clan) stripped him of his powers and thus no longer wanted to obey him. Kisuke Urahara was among the few individuals aware of the Soul King's current condition.
As Bleach: Can't Fear Your Own World III revealed, the Soul King was feared by the first Tsunayashiro, whose paranoia also led other clans to fear the former. Thus, all other families, except for the Shiba clan, decided to remove Soul King's body parts.
This caused the Soul King to be stripped of his powers. From being the most powerful being, he was now solely responsible for regulating the flow of souls in and out of Soul Society. This would ensure a stable flow between the three worlds - the Soul Society, the Human World, and Hueco Mundo.
Thus, when Aizen learned about Kisuke Urahara's invention, the Hogyoku, he decided to work against the Soul King. His first goal was to infiltrate the Soul King Palace, which required the King Key.
However, as revealed by the leader of the Soul King's Royal Guard - Ichibē Hyōsube, the King Key was the bones of the Squad 0 members that the Soul King enhanced.
Thus, when Aizen was trying to make the King Key, he was actually trying to wield his spiritual arts after fusing with the Hogyoku to create the Squad 0 members themselves. However, his plan was foiled after he was defeated by Ichigo Kurosaki's Saigo no Getsuga Tenshō.