The rule is no capture or a pawn move after 50 moves.
Castling is neither a capture or a pawn move.
A good point though as castling cannot be undone, though of course
after 0-0 you can move the King back e1 and the Rook to h1.
(and castle again! - there are a few examples of illegal castling taking
place three times in a game.)
I guess they never thought about the 50 move rule and castling because
the chances of it ever happening are (every recorded game to date - 1)
It has not happened yet in about 10 million games and I doubt if it
will in another 10 million.
The current record for the latest castling in an OTB game in on move 48.
(on RHP the latest I can find is on move 44 for both 0-0 and 0-0-0.)
The castling rules applies in 3 fold rep.
[FEN "4k2r/8/p7/Pp6/1PpK4/2P5/n7/6R1 w k - 0 1"]
{White to play, Black still has the right to castle.} 1. Ra1 {Once} 1...Rh2 2. Rd1 Rh8 3. Ra1 {Twice.} Rh2 4. Rd1 Rh8 5. Ra1 {The third time the same postion has occurred but in the first one Black had the right to castle so no claim for a draw can be made.}