You've left quite a bit to the imagination, here. Many of the details crucial to answering your question are not provided to us.
Notwithstanding the incompleteness of the available information, I think I know the answer. The synergy between alcohol and benzodiazepines is likely the reason you slept better the first night than on the second night. The strength of the effects of a particular CNS depressant—like alcohol or alprazolam or diazepam, in your case—will always be lesser than had it been adminstered in combination with another CNS depressant.
That is to say, alcohol and benzodiazepines potentiate one another; a Xanax tablet and a beer will both feel stronger if taken together than they would if taken by themselves.
You mentioned having drank alcohol the first night and say nothing about alcohol for the second night, so I can reasonably assume you had no alcohol the second night. If this assumption is correct, then the most satisfying answer (at least from my perspective) to your question is that the alcohol/Xanax/Valium concoction consumed on the first night is the reason you slept good. The absence of alcohol on the second night is the reason you slept bad. It is unlikely a benzodiazepine tolerance could accumulate so profoundly over the course of a single day, and therefore it is unlikely the situation has anything to do with tolerance.