The G-Man in the Half-Life universe is responsible for the Resonance Cascade, the Xen Invasion, and ultimately the Combine Invasion of Earth.
It’s pretty clear that the G-Man’s employers want to take down the Combine. They were looking of the ideal race to manipulate into that. The second to last race they tried were the Vortigaunts. However, while the Vortigaunts were powerful, they lacked creativity and adaptability. Instead of taking down the Combine, they became their most useful slaves. The G-Man’s employers turned to humanity. While not as strong as other species, humanity could adapt. They sent the Xen crystals to Earth with the G-Man being the courier as a test for humanity being their next shining hope. Being that humans were weaker than most species the Combine had already conquered, the thinking was that either the humans would win due to their adaptability, or the Combine would just destroy them outright viewing them as not worth enslaving. Either way, the G-Man’s employers had little to lose.
However, they never counted on some humans actually allying with the Combine. This allowed the combine to infiltrate human society fully, and become humanities de facto rulers. Humans were the first species to have members willingly become slaves to the combine, rather than having to be full out conquered and assimilated as every species before.
So they brought Gordon Freeman back to restore the balance. The G-Man pulled him out of stasis in the beginning of HL2 to clean up the mess that his employers had made. But at the end of HL2, it’s implied that the G-Man has his own designs on Freeman. I think he realized his employers screwed things up, and he’s going to leverage that screw-up for his own personal aims. Of course, the Vortigaunts threw a wrench into his plans.
The events of HL1 were no mistake by humanity. It was a calculated gamble by an unknown organization to take down their greatest enemy the Combine. That organization probably wants nothing more than to enslave other races themselves, but currently the Combine has the upper hand. But all the major players have shown that they underestimate humanity, except for possibly the G-Man. His hands are tied somewhat by his employers, but he’s molding his own soldier in Gordon Freeman. The G-Man plans to take down his own employers after they take down the Combine.
However, he made one major mistake which becomes clear to him in HL2: Episode 1. Gordon’s allies are far more loyal to Gordon than anyone ever expected. The G-Man is at his core a bureaucrat. Nothing is personal; it’s all just business. He doesn’t grasp that for Gordon and his allies, it’s both.