Because Papers Please!!
Passports used to be a courtesy to simplify international travel. Now they’re not only mandatory*, but, 1 second after their expiry moment, they are not longer recognized as valid identification or anything.
*Except for illegal immigrants
If you visit Europe, they must be valid for at least 90 days after your arrival. Wonder how the kid got into Spain, unless the family is Spanish.