My brother-in-law- who was giving us a tour of central London (it's what he does professionally and was doing yesterday as a birthday treat for Su Young) knew the answer. It's not a prison, its a fort. And what's a fort doing on the Mall? It was built in the 1940s to guard the approaches to Buckingham Palace. If the Germans had invaded it's where Churchill would have made his final stand. It would have been the epicentre and command centre for the Battle of London.
There are tunnels and safe rooms underground- still maintained- still in use. It's nice to know that if someone dropped a bomb on us the government of the UK would have somewhere to carry on its immensely important business.
What's it called? It's called The Citadel. If architectural beauty comes from form following function its a very beautiful building.