there is a difference between md5 and the common practice to use only the contents of a file as input. i guess this is because the tool md5sum takes a filename as argument, which is like a shortcut of "cat file | md5sum". you could echo the filename and its contents and pipe it into md5sum, you would have it.
so the better title would be "why i hate the practice of only using file-contents as input for md5 hashes and not taking the filename itself into account"