The 37-year-old, who was most recently seen hosting The Matt Lucas Awards on BBC One, announced on Twitter that the illness was "very painful".
Lucas wrote: "Admitted to hospital for a few days for a nasty infection in both ears. Morphine & IV(intravenous)-antibiotics. I'm all woozy..."
He later quipped: "I don't wish to be critical of this hospital because I know they are overstretched & doing their best but I haven't seen one Mr Men plaster," before conceding: "Turns out they HAVE got Mr Bump plasters but I didn't get one because I didn't say 'Please'."
The former Shooting Stars comic was consequently unable to join close friend and Come Fly with Me co-star David Walliams as he completed his 140-mile six-day swim for Sport Relief.
Walliams was supported instead by former EastEnders actress Barbara Windsor upon his victory, having raised more than £1 million for the charity.
Lucas denied speculation earlier this year that he had split with comedy partner Walliams.