To "work the system" means to follow the rules of the system to your best advantage. In the case of air flight, I do not see much advantage to be gained, by the way. Usually this idiom is employed for someone who knows many tricks that are legal, but not know to the average person.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.