It was the plan.
Jack is being forced to meet Beckett. When he enters the room , Beckett is standing near the window, looking outside. Jack immediately starts looking for Davy Jones' heart.
Beckett: It's not here, Jack.
Jack : What? What isn't?
Beckett: The heart of Davy Jones. It's safely aboard the Dutchman, and so unavailable for use as leverage to satisfy your debt to the good captain.
Jack is already pretty shaken with Davy Jones' and actively looking for anything that he can use against him. At this time, he starts developing a plan, along with doing anything and everything to avoid Jones.
Jack has no wish of openly stating his fears, but deep down, he is pretty much scared. Being a brilliant and cunning man, Beckett tries to win the situation by using Jack:
Jack: Close your eyes and pretend it's all a bad dream. That's how I get by.
Beckett: Perhaps you'll consider an alternative arrangement. One which requires absolutely nothing from you but information.
Jack: Regarding the Brethren Court, no doubt. In exchange for fair compensation? Square my debt with Jones... guarantee my freedom?
Beckett: Of course. It's just good business.
Jack: Were I in a divulgatory mood, what then might I divulge?
Beckett sees that somehow Jack was shaken by the threat Davy Jones represents. So he tries to take advantage of Jack, promising him protection from Jones and anything that Jack may need. Jack, in other hand, is more scared than he lets be seen; he tries to make a bargain with Beckett, the only guy at the time who has authority over Jones. That's the whole reason for Jack's promise to Beckett: to gain his own survival and freedom.
Later, identifying Will Turner as the traitor, Jack orders him to be taken to the brig.
Jack: Send this pestilent, traitorous, cowhearted, yeasty codpiece to the brig.
Later at same night he discovers (or at least hoped, he knew that Will had the knowledge to escape the brig like they did in the first movie) that Will has successfully escaped the brig and is trying to flee the ship.
Jack: You escaped the brig even quicker than I expected.
Then Jack realizes that he can use Will in his plan, and he will be able to use Will's will to free his father in his advantage.
Jack: William, do you notice anything? Rather... do you notice something that is not there to be noticed?
Will: You haven't raised an alarm.
Jack: Odd, isn't it? Not as odd as this. Come up with this all by your lonesome, did you?
Will: I said to myself,"Think like Jack."
Jack: This is what you've arrived at? Lead Beckett to Shipwreck Cove, so as to gain his trust...accomplish your own ends?
And how does your dearly beloved feel about this plan? Ah. You've not seen fit to trust her with it.
Will: I'm losing her, Jack. Every step I make for my father is a step away from Elizabeth.
At this time, Jack realizes that making Will Turner an ally is much better than just losing him, and he wants to get things into his own hands, under his control. So he thinks of a plan to use Will as a double agent.
Jack: If you choose to lock your heart away, you'll lose her for certain. If I might lend a machete, to your intellectual thicket... avoid the choice together. Change the facts. Let someone else dispatch Jones.
Will: Who? You?
Will has doubts believing Jack, but Jack has the cards to play with. Will's father, Elizabeth and everything, and he seems calm and in control of everything which pushes Will to trust him.
Jack: Death has a curious way of reshuffling one's priorities. I slip aboard the Dutchman, find the heart, stab the beating thing, your father's free from his debt, you're free to be with your charming murderess.
Will: You're willing to cut out your heart and bind yourself to the Dutchman... forever?
Jack: No, mate. I'm free forever. Free to sail the seas beyond the edges of the map. Free from death itself.
Jack wants Will to succeed, he wants to make sure Cutler Beckett sees Will as the one who betrayed the pirates and believe he is the type of guy who'll do anything for himself; and that Will can be useful against pirates. So Jack gives his compass to Will, stating:
Will: What's this for?
Jack: Think like me. It'll come to you. My regards to Davy Jones.
Then he pushes Will off the ship, so that nothing in Will's story sounds suspicious to Beckett.
Jack Sparrow is the pirate who always, always think about himself first. All he wants is to escape from Davy Jones' wrath, Beckett and his army, the people he hates (Barbossa, Elizabeth, Pintell and Rigetti, monkey Jack and Will Turner) and roam the sea. But at that time, he has to face many obstacles in his path. So he chooses to stand still and fight, not something he was famous for, and he needs a plan. A big plan with several combined sub-plans, all pointing to eliminate Jones' and Beckett from the equation. In this endeavour, he needs the every ally he can get. Jack understands that Will betraying them wasn't personal, and that Will could be an important ally in the unavoidable war. So among personal differences, he accepts Will as a pirate and trusts him with his actions. That's why Jack lets Will escape and gave him the compass, to let Beckett find Shipwreck Cove, where the final battle took place.