Historically, you would build a fortification to house a force that could exert control over an area. Maybe the castle is there to control river traffic and extracts tolls from the ferries and nearby roads. Maybe it was there to guard a bridge or river crossing. Maybe it was there to defend a coastline or major mining operation. That covers the strategic placement of major fortifications. Major crossroads and thoroughfares, major agricultural/industrial/political/cultural centers, and likely enemy avenues of approach.

Tactically, (A.K.A. small-scale map size) we have a few factors that the military would expect you to cover to build an effective defensive position.

Observation: your location must allow for the observation of the objective, avenues of approach to the objective, and avenues of approach to your position.

Cover and Concealment: You must clear out anything which could obstruct your ability to see and attack points of interest while allowing you to approach those locations with speed, surprise, and violence of action.

Environmental Factors: You must ensure that fires, high winds, floods, and other hazards do not endanger your position.

You also need to consider force projection. How many troops do you need on hand? How many additional troops could you raise and how quickly? Can you send a detachment of troops to intercept potential hostiles in a timely manner? Can you conduct regular patrols? Can you support friendly emplacements nearby? Can they support you? How are you communicating?

All of these things come up when your talking about defensive positions from a simple trench line to a series of concrete bunkers in the mountains. Historically, major castles were usually built over a few centuries at key locations that were continually important but simulating an entire nation's worth of wars and political feuds might be a bit over-the-top. The main thing is to have fun. If you have fun with a stupid Disney castle in your low-fantasy, grim-dark, steampunk world then do it. Don't get too bogged down in the details.