Why does the script contain the hash of the public key
A major pro other than shorter addresses is that breaking into your private key takes one more step (hash -> public key -> private key). Plus, if ECDSA gets cracked someday and you follow the one-address-per-transaction best practice, transactions with P2PKH scripts will only unveil public keys when the amount they "hold" is going to be spent, so anyone attempting to hack your private keys from public keys would end up with empty addresses.