@wolfgang59 saidI think that that's the most likely explanation. But with the en passant rule, the presence of a pawn on the third (sixth) rank doesn't prevent a pawn which it is attacking from moving two squares forward, it's just that pawns on the forth (fifth) rank that can take them, so I feel that that's inconsistent.
The logic of that is a bit of a puzzle. Castling is a king move and forbidding
a certain move of a piece in a certain circumstance seems arbitrary. I can
only think that the rule is there to preserve any mating patterns prior to the
introduction of castling. (The same thought process that introduced en passant)