Wentworth Woodhouse in Yorkshire contains five miles of corridors. Photograph: Don McPhee

The national obsession with property has deep foundations. The inviolability of the home was enshrined in law as early as 1604 – in the words of the attorney general: "The house of everyone is to him as his castle and fortress, as well for his defence against injury and violence, as for his repose." But if the home meant protection and rest it also signified social status and aspiration: in Britain class has always been mixed in with bricks and mortar. However, few these days, in public at least, would express their disdain at the "wrong" sort of houses with quite the de haut en bas lip-curl of Somerset Maugham, who simply dismissed a huge swathe of the nation's houses: "It is unnatural for an artist to live in a semi-detached villa and eat cottage pie."

Philippa Lewis's lively, discursive survey of domestic buildings is a story of attitudes as much as architecture. She ranges widely not just within architectural literature but fiction, poetry, periodicals and plays too – Ideal Home magazine gets more space than Pevsner. The introduction of pre-fabs or the way improvements in glass manufacturing changed the nature of British houses are of less interest to her than the lives lived in the resulting buildings.

Her chapter on the evolution of the cottage, for example, describes a relentlessly upward trajectory. In the 16th century Francis Bacon described cottagers as simply "housed beggars" and their dwellings as hovels. Although a Tudor act stated that cottages should have four acres of land attached, it was more usual for the families of the rural poor to be packed into their single-room structures, with their livestock, in a fug of smoke and grime. The conditions were made worse with the advent of enclosure and the loss of common grazing rights. No cottage pie there for Maugham to turn his nose up at.

The gentrification (a word first used in a 1965 report on London's housing) of cottages really began with the Romantics, as the likes of Gainsborough painted pictures of apple-cheeked rustics and quaint dwellings. The idea of the cottage was so transformed that by the 1790s the landowner Uvedale Price, a theorist of the picturesque, stipulated that they should never be painted white because then the cottage's "modest retired character is gone, and succeeded by perpetual glare" – not perhaps the most important consideration for the indigenous inhabitants.

While cottages were suitable for well to do families in straitened circumstances, such as the Dashwoods in Sense and Sensibility, they were simultaneously playgrounds for the wealthy. Few though have matched the absurdity of Craven Cottage, built at Kew in 1777 by Lady Craven, and later remodelled to incorporate an Egyptian saloon, a gothic dining room and a space for worship painted to resemble Henry VII's chapel in Westminster Abbey. Conditions for real cottagers were nowhere near as whimsical: in 1864 a Methodist survey found in some dwellings "conditions as bad as those witnessed in the cabin of a negro in the swamps of a slave plantation". Reality, though, didn't halt their appeal and today's cottage weekenders were already an established caste by 1904 when Modern Cottage Architecture offered designs for buildings that could be run "with just one servant" and Heal's brought out a range of country cottage furniture.

Terrace houses, on the other hand, were, from their inception in the late 17th century, always meant to be an adaptable form. They could be built to every size, on every terrain, for every social group and could encompass both the stateliness of the Royal Crescent in Bath and the high-density rows of the northern mill towns. It was a form that after the Great Fire of London also attracted the new property developers, with the now familiar need to maximise profits often taking precedence over building quality. Some Georgian terraces were made from bricks that contained ash and excrement and had floors so flimsy that dances were banned in case the roof beams gave way. And it wasn't until the use of stucco (which cost a quarter of the price of stone) became widespread in the 19th century, that terraces became generally elegant rather than utilitarian.

Lewis treats each of her building types with the same eye for the enlivening detail. Even with the country house, the most written-about type of British building, she adds interest to a familiar story by pointing out socio-architectural details such as the Duke of Devonshire's insistence, when rebuilding Chatsworth in 1687, that even the outside of the window frames should be gilded. In discussing Wentworth Woodhouse in Yorkshire (below) meanwhile, a house so huge that it contains five miles of corridors, she tells the story of one bemused visitor who was reduced, Hansel and Gretel-like, to crumbling wafers to mark the route between his bedroom and the breakfast room.

What Lewis's surveys also show is just how quickly attitudes to different building types changed. Flats and suburban semis were initially met with resistance, notably by those with intellectual pretensions. Suburbs were dismissed by one commentator as fit only for those "who love gossip and hate books and art and pictures", while in 1877 Sir Charles Barry, president of the Royal Institute of British Architects, thought it "would be difficult for the generality of Englishmen to imagine anything more miserable" than a flat. The English were late adopters: the Scots had had a word for them: "fletts", since the 15th century, but by 1974 one in 10 of the English and Welsh lived in them. The rise of flats and suburbs, of course, revolutionised ways of living: the former giving single men and women undreamed of freedom, the latter, with their promise of "Urbs in Rure", bringing commuting, ownership and new forms of community.

Lewis may not add anything new to the story of architecture, but with her breadth of reference and sprightly style she shows how the British psyche can be read through our buildings, a theme she illustrates with a wealth of "interesting features".

• To order Everyman's Castle for £15.49 with free UK p&p call Guardian book service on 0330 333 6846 or go to guardianbookshop.co.uk.