Castling is an incredibly useful in chess: three moves in one. So we don't have to hunt far for reasons why it can be the best move strategically.
One common comparison is between the castling and the rook move to the d file or f file. Basically the king may need to move offensively, or defensively:
- to cover a flight square for bK,
- to attack a pieces (castling can be double attack),
- to avoid being checked/mated,
- to get out of the way so that the rook delivers check or can move.
In basic retrograde analysis, castling is used as OP pointed out, to deny the opponent's castling in certain situations.
In more sophisticated retrograde analysis, under the A Posteriori condition one player captures e.p., which would not normally be allowed, but a later castling "proves" that the e.p. was in fact justified as no other move could have been made.
In Dead Reckoning, castling may be the only way to keep the game alive, even if the result of the problem is in the end a draw. This also may allow the legality of castling to be deduced through retrograde analysis, without using the conventions. It is not normally possible to reason positively about castling using R.A.
In an antique version of the conventions, it was thought that castling would reset the counter for draw by 50 moves. So a few problems by Plaksin exploit this trick. This is still a matter of controversy even today.
There are also joke problems involving "playing at odds" so one player is missing a rook, but is still allowed to castle with the king moving twice, even though no rook actually moves. I don't know whether occupation of the vacant corner square would be enough to demolish the castling right, generally not, as some of these problems have a rook on the haunted corner square which did not originate there, either coming from the other side or promoting.
I'm aware this is a all bit dry so far, but we could find examples of all of these ideas if folk are interested.