I don’t know the legal intricacies, or like I said- whether it is at the state or federal level. I’m just reporting my personal experience with naming my children who were born in the state of Washington. I did not want them to have a hyphenated last name, so the absence of that hyphen means they have two middle names.
A fictional example: : Gabriel Patrick Larson-Hamilton vs Gabriel Patrick Larson Hamilton. The latter is what appears on a kid’s birth certificate, SS card and passport. On most other forms and records, it was easiest (and completely legal) to shorten it to Gabriel Hamilton, Gabriel P. Hamilton, etc. The “Larson” doesn’t even appear on his drivers license.
The hyphen would have ensured it was ALWAYS Gabriel Larson-Hamilton as his full legal name.
Since middle names are optional (and not everyone even has one), I suppose there had to be some way to designate whether a name is a middle name, or part of a surname.