General Morshower explained it clearly to Lennox, when discussing the plan.
They would negotiate with Megatron purely to use Megatron's ability to hunt down the location of the Staff. After they got the location, their ceasefire with Megatron would be over and they'd take him out, and get the staff for themselves.
You can see that the military didn't fully cooperate with Megatron, as they did deny him one of his chosen Decepticons (Berserker). And Santos clearly said to Lennox that after they got what they needed for Megatron, he was going to take him down.
So, it was merely a tactical choice. Humans didn't have the resources to locate the staff before Cybertron's arrival, so they needed to team up with someone who did know. At that point, Megatron was their only option considering the Autobots didn't even seem to be aware that the staff existed.