i'm still frustrated with the sleep button behavior on my iphone 5. I have to push it several times for the phone to lock. it's driving me mad! its not hardware related, it started right after the 7.1 update. there is a long thread on the apple support forums.
This is so basic APPLE, how can you miss that?
I'd say it's hardware, I had the same problem with my 5 and so has a friend with his 5. Both were swapped under the warranty, I suggest you do the same if you still can.