Why do we use "at"instead of "in"?
There are some very commonly used statements where we always use "at"to refer to the location of something or someone and never use "in". Here are some examples:
When you stay at a hotel on the beach you are literally on the beach when you walk out of the beach side of your hotel.
Tips for keeping the weight off for good. Here are a few tips to help you stay at your goal weight: Don't go overboard.
She prefers to stay at home.
My question "is it because of some rules of grammar rules that these sentences follow "or "just because the native speakers say it that way"??
As John Lawler says in a comment, the choice of preposition is often arbitrary and ideosyncratic. But I think there are some common patterns.
in is usually used when you want to emphasize your position being inside something. So you sleep in your bedroom. If you get arrested, you're put in jail.
at is more commonly used when you're talking about a place, but not treating it as a container that you're specifically inside. When you're at home you can be inside the house, or gardening in the yard, etc. When you're at a hotel you can be in your room, or outside in the pool, etc. (notice that I switched to "in" for all the spaces associated with home and the hotel).
at is also used for conceptual places. "home" is conceptual, while "house" is physical, so you're at home but in your house. And this applies for figurative places like a goal weight (but on the other hand, you're in good health -- as I said, it's ideosyncratic).