Upvote:4
After your flight from Glasgow you will not be able to go airside for your onward flight the next day, even if you wanted. You will arrive in the domestic arrivals area and then exit into the public part of the airport. In principle you can remain here overnight if you wish but it is made deliberately uncomfortable to discourage this.
The only hotel you can access without leaving the terminal 5 area is also one of the most expensive (the Sofitel). However it is very easy and reasonably pleasant to stay in: I would be disappointed not to be in bed within 30 minutes of landing with this hotel. It sometimes comes up on anonymous hotel searches like Priceline as the only five star hotel in the area at a sizeable discount.
There is I think a Yotel in the central terminal area. You can get to this area for free on the local public transport.
There are about 50 other hotels in the surrounding area of variable quality, price and distance. Almost all are beyond walking distance. The hotel "Hoppa" shuttle bus is not free (£5 each way) but if you stay on Bath Road or within the London transport area you can use the free local red buses instead. (London buses are free in the immediate vicinity of Heathrow.) You may wish to factor that in if price is a concern to you.