It’s to the advantage of the monarch if they can focus their military resources to external borders as opposed to internal garrisons. So if the castle is far from the borders and doesn’t control an important area from a national as opposed to regional or local perspective, better to demolish than occupy.