Why did so many nobles and courtiers of Shah Jahan offered their allegiance to Aurangzeb?  

This topic is very important because its often overlooked. The emperor in theory enjoyed absolute powers but he could govern effectively only through his nobles or officers. His policies would only be implemented through them therefore directly or indirectly their opinions and interests mattered. We begin by observing the general attitude of Aurangzeb towards the nobles of the court followed by the support he received at the most crucial moment of his life at Agra. It is fair to state that Aurangzeb would have never successfully and peacefully deposed off Shah Jahan without the help and support of the nobles. In the same breath it is a fact that one of the reasons for the collapse of the Mughal Empire after the death of Aurangzeb was due to factional fighting amongst the Turani, Irani  and the Saadat-e-Baraha nobles.