Moisture gets in them and causes havoc. When you wash the bike put a piece of saran wrap over the top of it until you are done. It will stop most of the problem. The other thing I do once in awhile is to release the gauge, pick it up partway out of the tank and let it air dry. It will go back to work then.
"Most of my money was spent on Motorcycles, Women, and Whiskey...The rest I just wasted"