From Bulbapedia, the community-driven Pokémon encyclopedia.
The Pokémon Inspection Agency, or PIA for short, is an agency that inspects Pokémon Gyms.
The agency first appeared in Showdown at Dark City as the organization that the Yas and Kaz Gyms attempted to impress in order to become an official Gym, nearly destroying Dark City in the process. Later, the agency turned them both down after discovering the gang wars they were involved in.
Undercover Nurse Joy in Dark City
The agency reappeared in Cerulean Blues, where a TV report shows they have recently shut down four Gyms in less than a month. One agent said that they would shut down any Gym that was "unsafe, unclean, or uncool". Upon hearing a rumor that the PIA was headed for the Cerulean Gym, Misty rushed back as fast as she could, fearing that the PIA might beat her there.
Later on in the episode, a Nurse Joy that was helping Misty calm a rampaging Gyarados revealed herself as a PIA agent when she gave the Cerulean Gym a passing grade for its inspection.
Another Nurse Joy from the PIA appeared in SS025. She was aware that Forrest was not the official Gym Leader of the Pewter Gym and demanded to see the true Gym Leader, Brock. She and Brock battled but he lost to her. Because of this, she announced that she would shut down the Gym.
The next day Nurse Joy decided to give the Gym another chance. If Forrest battled her and he won, she would not shut down the Gym. She surprised everyone when she called upon her Latias, a legendary Pokémon. Forrest put up a tough fight with his Rhyperior but both ended up losing to Latias. Still, Nurse Joy was impressed by his skill and decided to name him as the official Gym Leader of Pewter City.