Well, 50-50 for me.
We can't actually says he wanted to be Emperor when he opened the gate. Or he's a traitor. We have to understand the situation he was in.
At that time, the rebels had already sacked the capital, and the inept Ming Emperor had already put himself hanging from a tree. The Ming Dynasty, had in fact, already fallen. Not a Traitor in any sense.
No matter what the situation was, the conflict between Ming and Li Zicheng was a domestic matter. Chinese vs. Chinese. Even though Ming's capital was sacked, Ming was not yet destroyed. Even if Ming was destroyed at the time, China was still a sovereign nation under Han. Wu opened the gate and allowed the Manchurians to be involved. That was betrayal.
Secondly, The rebels may have taken the capital, but I doubt they are strong enough to stop the manchu invasion. They are just a rag-tag military force with popular low caste support, against demolirized under funded second and third rate Ming forces.
No matter the strength of Li's army, the fact is Wu invited Manchurians in. It was possible that Manchurians would still manage to sack the Shanhai Pass and march to Beijing and defeat Li, but that does not change the fact that Wu surrendered without a fight. This is like saying in the WWII, people knew that the Chinese army was no match to the Japanese and so there should be nothing wrong with any of them laying down their weapons and surrender without a fight.
Thirdly, The rebels would behead Wu San Gui and his men, the very moment they surrender.
No, Li planned to convince Wu to join force with him. In fact, Li sent a letter to Wu and tried to convince Wu to join him. Li may be a rebel, but he was no bum. He knew fully well the meaning of Shanhai Pass and Wu. Ming forces had been battling Manchurians for decades by that time and everyone in China knew about the Manchurians. I highly doubt that Li would kill Wu since there were many generals under Li's command who used to serve the Ming dynasty. If Li didn't kill any of them, why would he kill some one who was so much important than any of the others combined?
Lastly, how dare they steal his beloved concubine.
This is the part that annoys me the most. Why blame the woman? You think Wu who should have multiple concubines at the time truly cared about a hooker? Li Yuanyuan was, after all, a high class prostitute. Chinese historians have this high tendency to blame women for the mistakes of men. This to me is sad. At least, be a man and admit your mistakes.
Now, imagine yourself in his shoes. Would you surreneder to a rebel, or an Empire that promise you longevity ?
If it were me, I would rather be killed by the rebels than surrender to a foreign enemy. In fact, many people have done just that. Only a handful of people have chosen to align themselves with the invading foreign power and help the invaders kill his own countrymen.
Plus, he was in a much better situation than you painted him to be. With him guarding the Pass, Manchurians had absolutely no chance of getting into China. He could use his over one hundred thousand cavalry to bargain a deal with Li Zicheng and force Li to let him be on his own. There had been cases like this. Generals from the old dynasty who was guarding the border bargained with the new dynasty and become a war lord and essentially his own local emperor. Luo Yi of Tang dynasty would be a good example of that. He actually went through 3 dynasties as the local governor of Yanjing, Late chen, Sui and Tang.
So in summary, there should be NO personal excuses when it comes to maintaining national sovereignty!! Any act that allow foreign troops to enter one's country, however that would affect the life of the person who gives the order, will be considered treason. Plain and simple. This would be true in any nation on this planet. What would you call a foot soldier who surrenders to his enemy on the battlefield for fear of being killed and eventually comes back with the enemy and attack his own country?