Marked by Piranesian and claustrophobic architecture, the painting's only light source is a barred window high up on the wall, clearly meant to repress the figures below. These figures are distinct characters, all engaged in grotesque and pitiable behaviour - one wears what seems to be a wild-feathered headdress, another is fighting in a tricorne hat, another makes a gesture of blessing to the viewer, whilst many of the others are naked.
The subject of psychiatric institutions was a hot topic in the salons of the Spanish Enlightenment and so this painting could be meant as a denunciation of then-current practice in that area. Even if it is not, Goya was always attracted to representing madness, deformity or perversion. Some of the figures can also be interpreted allegorically, as a gallery of parodies of powerful figures in society, such as the clergy or the army (the man in the tricorne). It develops the topic of 'the world of dreams' ('mundo al revés') and is related to Goya's engravings series Los disparates.
Goya had already touched on the issue in his 1793 painting Yard with Lunatics, but The Madhouse shows greater variety, with less mad, less picturesque, more individualised and more characterised figures, shown more humanity and clearly marked as poor victims of marginalisation and rejection.