It's nothing to do with ghosts. The poorer Thais are simply scared of sleeping alone, because they're simply not used to it. That's all there is to it.

I remember with Kim and myself, and we had a nice 4bdrm house. At times there would be anywhere from 6 - 12 people staying there, and for a bit it was Kim's little sister and her baby. Yet, they all slept in the living room. Kim became accustomed with A/C, so he'd usually come sleep with me because he was horny and liked his A/C. Everyone else slept in the living room though, leaving 3 full bedrooms empty.

Just realize where the poorer Thais come from. They grow up in the village, and from the time they're born entire famly (including extended family) sleep in one room, because that's all they can afford. So to be alone in your own room at night is scary for them, same as it is sometimes for a 6 year old in the West, hence night lights and shit.