The most common reason is that the Israelites overslept on the morning they were supposed to receive the Torah, so staying up all night “fixes” that missed opportunity.