It's not a good idea to spend the night at the beach in a sleeping bag. It can be risky due to potential weather conditions, dangerous wildlife, and other safety hazards. Plus, many beaches have camping regulations that you should be aware of before planning to camp there.