What benefit does a surgical mask have over simply using a handkerchief or shirt to cover ones face?

Some. A surgical mask has a few benefits. While it has not quite caught on here, in some places, such as japan, it is considered polite to wear a mask when you have a cold and prevents any incidental spittle, dry coughs, etc. From spreading infection. The mask is guaranteed to be clean and stay over face without using the hands. A hankerchief may need a hand to hold in in place, further spreading germs.
Rated. Each type of mask is a filter rated to certain size of the airborne particles. Handkerchief is helpful but with very limited capacity for small particles.