At one time I could keep my iPhone from going to sleep by choosing the Never command in the Auto-Lock screen. However, this option has disappeared. Did Apple remove it with iOS 4?
No, this is a long-standing issue – and it’s the expected behaviour rather than a bug. Our best guess is that you’ve added an Exchange account to your iPhone. Security settings within Exchange servers can be (and often are) configured so that your iPhone (or iPad or iPod touch, for that matter) is required to lock after a certain period of time. Thus, the Never option disappears because it’s an option you’re not allowed to use.
And it makes sense. Suppose you’re carrying around state secrets on your iPhone, which you’ve chosen never to lock, and you leave it in a spy’s bedroom. To deal with the issue, you might send a note up the line to the group that administers your Exchange account and see if your security settings can be tweaked so the iPhone can be configured to never auto-lock.