Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
When you lock the phone, wifi turns off unless its actively being used in the background. Once you wake the phone up, it immediately kicks back on. It's normal and been discussed before.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.