Nowadays there are planning rules to control how people extend their homes, but not so long ago owners could do what they liked. And in Silverdale*, Lancashire, several built what's known as 'spite walls' just to get one over on their neighbours.
There are examples all around the village, but one of the best known is in Stankelt Road. (This link will open Google Streetview.) Apparently the house on the left had a clear view over open countryside until owner Right decided to put his house smack next to the boundary. So Left built the huge wall, cutting out light and getting his own back on Right.
Other walls exist throughout the area. It's a coastal village and some were erected simply to prevent next door having a sea view! The people of Silverdale appear quite friendly these days so it's not clear why they were so aggressive in the past. Neither is it clear why nobody knocks the walls down these days.
Some have been lowered, as a gesture of goodwill. The book Cheek by Jowl: A History of Neighbours, by Emily Cockayne gives details of one in Shepton Mallet (Somerset) that's protected by Grade II listing.
*Silverdale is on the west coast, on Morecambe Bay, just north of Lancaster and VERY close to the Cumbrian border.