Why does the screen come on when my phone is plugged in but idle? Sometimes when my Nexus One is plugged in with the screen switched off, the screen turns itself on (showing the lock screen) seemingly randomly, and I have the "Stay awake" Development option turned on, so it stays switched on until I manually switch it off again.

I suspect that some app is inappropriately obtaining an ACQUIRE_CAUSES_WAKEUP WakeLock. Is there a way to get a log of WakeLock activity or some other way of debugging this?
The same happens occasionally on my Galaxy S, usually about 5-10 minutes after plugging in. If you can handle the dev tools, you could try charging the phone from an USB port while running logcat and checking what goes on around the time the phone activates, or if the screen turns on only when charging from a wall socket you could run aLogcat on the phone while charging and then try to see the reason, but it can be a bit tricky on the phone.