When building a town in the game currently, it's almost impossible to not build redundant/unnecessary buildings.
The reasons are variant, upgrading research buildings, protecting your country or just to have it when the need comes, to name a few.
That being said(Or written), as the game is right now, there is a great penalty within the game for doing so, mainly construction time increase but, low food production as well, which is fine for buildings that are useful for you, but hardy seems fair for ones not used.
So I suggest to have a way to deactivate/turn off a building for a period of time, rendering it entirely useless even for the most basic use (for example using upgrades already built in a forge), with a cool down on reactivating it after deactivating so you can't abuse it to have less consequences for useful buildings.
In addition I would suggest not to make the cool down too severe so you could reactivate a defense/army building on time before an attack is arriving.