I used to think pregnant women who did so were just showing it off..and I used to hate it.
But now Im pregnant myself, I find myself doing it all the time without even thinking about it - it comforts when there is pain (like that stretchy ligament pain you get at the sides), and its also something I just do naturally to bond with that little baby that is trying to get my attention with all those little kicks - I feel if I didnt acknowledge bubs when its awake and playing about, I would feel disconnected from it.. its kind of a way of communicating with each other.. like I wouldn't ignore someone who was talking to me IYKWIM.
Also being a first pregnancy, its like when baby is kicking really hard, putting my hand there gives me a sense of comfort that its foot is not going to pop right through!!
I did notice a lady look at me the other day for a bit too long when I was rubbing my belly.. I hope she wasnt offended.