Ichimaru has been wanting to kill Aizen for a long time, since back his Vice Captain days, his reasons are unknown. Most likely he cares about Matsumoto.
And Base Aizen has no unguarded spots, so he would be throwing his life away by attacking Aizen when he still had his guard. Aizen powered up became overconfident that he threw away some of his guard allowing Ichimaru to land a blow on him.