I don't know why Castle did theirs but SPN started talking about it as a tribute/homage after Kim Manners passed away last year. maybe Castle did theirs for the same reason, if the crew overlapped with X-Files in some way? Or if he directed any of their eps?