I have seen similar pits under the hostel building when I was in Kuching, and again, in Tawau. I thought they were antlion pits at first, but upon investigation, turned out to be something else.
No antlion larva inside, just a worm!
See how this wormlion deals with an ant that falls into the pit!
The worm looks like this:
I posted the gif animation on my Facebook and within minutes, got the answer from some of my really knowledgeable friends. Thanks!
Some great info about wormlion (Vermilionidae) at this site.