iPhone and iPod touch: Wrong passcode results in red disabled screen
Summary
iPhone and iPod touch allow you to set a passcode to be entered when powered on or when the wake button is pressed. This is explained in the iPhone User's Guide and iPod touch User Guide.
Products Affected
iPhone, iPod touch, iPhone 3G, iPod touch (2nd generation)
Note that if you enter the wrong passcode you'll see a screen that says "Wrong Passcode, try again."

If you enter the wrong passcode too many times, you'll see a message that says "iPhone is disabled" and to try again later:

Note: The screen on iPod touch will read as "iPod is disabled."
If you repeatedly enter the wrong passcode, iPhone or iPod touch will be disabled for longer intervals, before you can try again. After too many unsuccessful attempts, you won't be able to try again until you connect to the computer you normally sync with. Note that starting with iPhone 2.1 software, there is a setting to cause the device to erase itself after 10 consecutive incorrect password attempts. This setting is off by default. It can be turned on by tapping Settings > General > Passcode Lock after you enter a correct passcode.
If you cannot remember the passcode, you will need to restore your device on the computer that was used to originally sync the iPhone or iPod touch so that you can reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced to the iPhone or iPod touch, you will be able to unlock the device for use and remove the passcode but your data will not be present. Refer to "Updating and restoring iPhone and iPod touch software."
If the issue continues after updating and restoring iPhone and iPod touch software, refer to this document.