Why is it not legal to loan your child money for a down payment or a mortgage for their first home?

Because the lenders want it as a gift so there is no family squabbles after the fact.. You can’t borrower any money regardless of the source that is a loan that is unsecured. If you do a loan against their car, then it is fine or a mortgage that you record.