Philippe Jeannard, 61, of La Rochelle was arrested March 20 after using the fraudulent identification card of a former Air France employee to board the U.S. Airways plane, Philly.com reported.
No one was injured or endangered by his stunt, officials said.
U.S. District Judge Gene E.K. Pratter said whether it was a prank or carried out with malicious intent, the incident had serious ramifications.
"There is a victim or victims in this case, and that's the traveling public of the United States," the judge told Jeannard, a retired advertising executive. "No one is able to look into the heart of a person who gets access to a cockpit of a plane and determine if he's a terrorist or a jester."
The news website reported the Frenchman had worn a fake pilot's uniform to impress a woman he was dating in Palm Beach, Fla., his attorney said. Jeannard also said he has held a life-long admiration for pilots and fantasized he, too, was one, Philly.com said.
Jeannard wound up in the aircraft's cockpit after demanding an upgrade to first class at the gate and flashing an Air France ID card while wearing an airline shirt with a captain's epaulets. He was asked if he was a pilot and was invited to inspect the cockpit as a courtesy, Philly.com said.
It wasn't until he got into a dispute with crew members over his luggage that he was removed from the plane and it was discovered he was a fraudster.
Assistant U.S. Attorney K.T. Newton said Jeannard gave investigators "several different stories" about whether he had accessed cockpits before.
Public defender Elizabeth Toplin said her client had an "almost childlike fascination" with planes and was "truly, truly remorseful" for what he had done.
Jeannard was held until Tuesday when Pratter sentenced him to time served and ordered him to reimburse the government for legal fees of $4,875 plus a $100 special assessment.
The U.S. attorney's office in Philadelphia said in the future Jeannard not be permitted to enter the United States without written permission from the secretary of homeland security.
Caroline Berg Eriksen: Soccer player's wife triggers debate with post-birth selfie
Theater accidentally screens 'Nymphomaniac' trailer instead of Disney's 'Frozen'