Project vs. protect actually doesn't make a difference here. It's a fortified base from where sorties can be sent out into the surrounding area, projecting the noble's power.
To stop that from happening, one has to capture the castle or be friendly with the garrison. This creates problems for anyone passing through, be they farmers, merchants, unfriendly neighbors of the noble, or an army passing through.
Peacocking might have happened, but castles would be a useful form of peacocking. Be as that may, they were still mostly uncomfy money drains, barely earning back their running costs via tolls, and usually funded by major nobles who then sent their underlings to actually man the place. If at all possible, one would rather build two castle in useful locations than a single redundant one.