Surely, it could just have easily been put inside the file, and with an explanation of what it was?
On a technical level, you can't put the hash value in the file because changing the file to put the hash inside it changes the hash of the file itself and they will no longer match.
What a hash value does is to give you a way of comparing the contents of one file to another to ensure that they are the same. If a single change is made to a file, the hash changes, which tells you that the file has been tampered with. It doesn't tell you what
has been changed, just that it has
As an example, I've copied and pasted your first post into a plain text file. The SHA-1 hash of that file is 03bd41409bb045016ef6ae5ef5e7b062e2814c38
When I edit it such that there is no obvious visble change, by removing the space after the final word, 'longer?', the hash changes completely to d64527d3ef3f54eb20b741a712ca190b111e0bb6
You can see immediately that the two files are different because the hash values are different.
These files are a different length as the second file is one character shorter so you might be able to detect there has been a change just by looking at the file size (2534 bytes vs 2535).
What if I put a space back at the end of a different line to make the original file and the modified file exactly the same length? You still won't know it's been modified just by looking at it quickly and you can't tell by the file size. I now get a hash of d89e6dbcd32e5faa8ebbfaddd4369d905dd803c1 - which is different again.
Apart from the technical reason you can't include a hash for a file within the file, you also don't want to do that because it would mean having to open the file to view the hash value.
The aim of generating and publishing a hash for a file is so that you can check it hasn't been altered, e.g. to include malicious code. If there is
malicious code you want to know before you open the file.
As for why Microsnot has chosen to include the SHA-1 hash in some file names but not others, I don't know. Newer operating systems may have different mechanisms for verifying the integrity of patches which XP doesn't - digital signatures, for example.