Correct me if I am wrong, but one of the reason the computer sleeps when you close the lid is because it isn't good for the computer to be shut while on. So, yeah this could be a bad thing but at least you know now.
You can use the MBPs in clamshell mode, which is when an external monitor keyboard, and mouse are connected but the screen is closed. The machine is on.
Note:
I've had this exact same problem. I cannot isolate what the issue has been, but I'll tell you a few things you can try:
1. Reset the computer
2. Reset the PRAM [Turn the MBP off, remove the mag safe power adapter and the Battery. Press and hold the power button for 5 seconds while no power sources are attached. Replace battery and magsafe, turn computer on.]
3. Delete these files and ONLY these files:
/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist
/Users/username/Library/Preferences/com.apple.systemuiserver.plist
/Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
You may not have the AutoWake.plist file. I didn't.
I had tried the first two methods to only limited success. I found the third method on the below discussion on the apple.com website. This seems to be a common problem for MBP owners.
http://discussions.apple.com/thread.jspa?threadID=636696&tstart=75
For me, the third method is the only one that's worked for any significant period of time. It's possible the problem may return, couldn't tell ya.
Also, for problems like this, I often find much better solutions in the Apple.com support discussion group threads than here on Macrumors. do searches on those message boards, you can find all sorts of things.