Technically true, but incomplete.It's not an accident that things like the Geneva Convention are usually silent on spies despite being very comprehensive on soldiers at war, prisoners of war, civilians in a war zone, civilian government of warring nations, etc etc etc.
1. A "spy plane" pilot would be wearing their own uniform, and the aircraft wouldn't be "disguised" either, so for purposes of the rules of war, they wouldn't actually be spying. They'd be conducting reconnaissance.
2. There are rules governing spies:
A spy taken in the act may not be punished without previous trial. This requirement was already recognized in the Brussels Declaration and the Hague Regulations. It is also set forth in a number of military manuals. Captured spies are entitled to the fundamental guarantees set out in Chapter 32, including the right to a fair trial (see Rule 100). This is emphasized in the military manuals of Canada, Germany, New Zealand and Nigeria. It is also laid down in Additional Protocol I, which states that anyone who is not entitled to prisoner-of-war status, and does not benefit from more favourable treatment in accordance with the Fourth Geneva Convention, still enjoys the fundamental guarantees of Article 75 contained in Additional Protocol I. Consequently, the summary execution of spies is prohibited.