Do you have a case on your phone? If so, remove it and see if that fixes it.
Mine isn't working either. It was fine until I took part in the S/W upgrade trial with Motorola for 2.3.4
I've sent Moto an email to fine out if this is an issue from the upgrade. I thought at first it was just the theme I was running, or a case issue, but it's not. The phone is "naked" and it's still doing it. Really frustrating.
I didn't participate in the soak test, but, got the official 2.3.4. My sensor is working fine. I hope it's not a hardware issue. :'(
I think I have figured it out, the sensor doesn't turn the screen off when I have headphones plugged in... So I think it has to do with the update because I specifically remember my screen turning off before, so I dunno
Interesting feature I just noticed is that when you have music playing and you answer your phone the music stops (obviously) but when you finish your call the music gradually increases the volume to where you had it instead of going back to where it was. I listen to my music loud and it has scared the crap out of me on multiple occasions because I wasn't expecting it lol