Red played very poorly, and dumped ~20k in credits on bounty over the course of the game. He could have probably bid half or a quarter of what he did and still won both pirate raids. Neither you nor your ally were actively counter-bidding, and on the second raid defenses had built up to such a level that the pirates (even Diplomacy pirates) weren't a big deal, so the raid wasn't even worth 1k credits, much less 10k. Beyond that, HuyMac was handily owning the neutrals in the center of the map and pushing you guys quite easily all on his own.
The only hint he had that there was anything of value beyond the wormhole was the sudden disappearance of your scout swarm. I keep track of my enemy's assets, and having a big chunk of enemy units suddenly go unaccounted for sets of alarm bells for me. However, HuyMac either didn't notice or didn't consider what it meant for the wormhole, and let your control that amazing wealth.
That said, you guys could have definitely done a better job defending and holding the neutrals. You were really getting hammered, and if it wasn't for all that extra income that let you starbase all your planets, you'd have lost very quickly.