By documenting the evidence at the time it exists. If they don't let you board, insist that they give you something in writing. If they refuse, make a short video that documents their refusal as well as the time and date (there are lots of clocks near the gate).
It's just like when you order something online, you make a screenshot of the order page, because even reputed companies can and will occasionally change order details retroactively, and will only revert the changes if you have proof that they did this.
It takes a bit of paranoia to do this, but that comes very naturally after one or two experiences like the OPone described by the OP.
Alternatively, you can hope you find a witness. Unfortunately a close friend or family member usually doesn't count, which makes this quite difficult in practice.