I agree that early on it seems to run contrary to the narrative, but you quickly realize you're not in the imminent danger you assumed you were in the beginning.

Allowing you to long rest whenever you want feels like it was done by design, as a lot of the plot progression happens in camp. Also why the combat encounters are higher in difficulty - to "encourage" you to return to camp frequently.