The gate agent in the original article may have provided bad info re. the law. It is however Southwest Airlines right to refuse boarding. Page 8 of their contract for carriage, that ANY passenger, by default, agrees to when purchasing a ticket. I'll paraphrase:
Southwest may deny boarding, or remove any passenger for the following:
C. Failure to show a government issued ID.
These are the terms of the contract he agreed to when he purchased the ticket. He was unwilling to perform and was denied boarding. All within SW's rights.
I think the gate agent was incorrect in "It's the law"
The carrier has the right to check ID, but is not obligated to do so. Again, in the Contract for Carriage.