The photo ID issue is another classic case of desiring A and regulating B. Like using speed bumps instead of enforcing speed limits.
It certainly has nothing relevant to do with security.
If anyone wanted to travel on another's ticket, all that is needed is for the holder of the ticket to check in and get the boarding pass, then give it to the other person and go home. Admittedly, this would only work for a one-way ticket.