A checksum can only tell you if the file is identical to another. Even if it did - you downloaded the file from untrusted location for a reason - you don't have access to original source.
Checksums are useless if you don't have access to an alternative source.
Xcode.app includes a digital signature, which can be checked with `codesign`. As all OS X comes bundled with Apple's root certificate, one can check for the validity of that application by oneself without any additional trusted source.
Or if the developers never disable GateKeeper and read the warning, they will know that the application is not genuine.
Checksums are useless if you don't have access to an alternative source.