That question is kind of moot. It's like asking why can a pawn capture en passant? And only on the first turn the opportunity is available?
I suppose, for my 2-cents, castling out of check is not allowed possibly because you theoretically could castle out of a double check? Or a checkmate? Maybe?
Im sorry if this has already been asked before, but a search failed to return any relevant results. Anyway, I was wondering why it is illegal to castle out of check? I understand why the king can't pass over or end up on a square that would place him in check, but why is this the only manuever that is absolutely illegal for removing the king from danger?