All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Spending the night at Muzdalifah is one of the obligations of Hajj. This is the viewpoint of the majority of the Muslims scholars amongst whom are the four known Imaams. They only differed on defining the compulsory period which one must stay.
Imaams Shaafi'i and Ahmad ruled that spending the first half of the night is compulsory for the one who reaches before midnight. If one cannot do this, it is sufficient for him to stay for one hour only during the second half of the night. Imaam Maalik said: 'A short stay at any time of night is enough.' Thereupon, if you stay in Muzdalifah for a short period and leave it after midnight, then you would fulfill your obligation, especially if you are performing Hajj with your wife.
Staying the whole night till the Fajar is only recommended for those who would not face hardship in their stay. If spending the night does not subject you and your wife to any hardships, then it is better to spend the whole night in Muzdalifah, and depart to stone the pebbles after the sun rises. This is how the Prophet Muhammad performed Hajj.
Allaah Knows best.