It was the plan.
Jack was being forced to meet Beckett. When he enters the room , Beckett was standing near window, looking outside. Jack immediately started looking for the 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
Jack was already pretty shaken with Davy Jones' and actively looking for anything that can use against him. And at this time, he started developing a plan, along with doing anything and everything to help avoid Jones.
But Jack had no idea to state his fears openly, But in deep down, he was pretty much scared. Being a brilliant and cunning man, Beckett tries to win the situation by using Jack. see following quote,
Jack: Close your eyes and pretend it's all a bad dream. That's how I
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 from Davy Jones. So he tried to take advantage of Jack, promising him protection from Jones and anything that Jack will need. Jack, in other hand, has scared more than he admits to show, tries to make bargain with Beckett, the only guy at the time, 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 take to the brig.
Jack: Send this pestilent, traitorous, cowhearted, yeasty codpiece to the
later at same night he discovered (or at least hoped, he knew that Will had the knowledge to escape brig like they did in first movie ) that Will has successfully escaped the brig and trying to escape the ship.
Jack: You escaped the brig even quicker than I expected.
Then Jack realizes that he can use Will with 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 as ally is much better than just losing him and he wanted to get things into his own hands, under his control. So he thought 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 altogether. 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 nothing but 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
Will: You're willing to cut out your heart and bind yourself to the
Jack: No, mate. I'm free forever. Free to sail the seas beyond the
edges of the map. Free from death itself.
Jack wanted Will to succeed, he wanted to make sure Will is the traitor on pirates on eyes of Cutler Beckett. Jack wanted to let Beckett believe Will is the type of guy who'll do anything for himself and can be useful against pirates. So Jack gave away 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 off will off the ship, so Beckett has nothing suspicious on Will's story.
Jack Sparrow is the pirate who always, Always think about himself first. All he wanted to escape from Davy Jones' wrath, Beckett and his army, the people who he hated (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 needed a plan. A big plan with numerous number of plans combined, all pointing to eliminate Jones' and Beckett from the equation. In this en devour, he needed the every ally he can get. Jack understands Will's betrayal on them, it wasn't personal, and Jack understands that Will could be a important ally against the unavoidable war. So among personal differences, he accepts Will as a pirate and trusted him with his actions. That's why Jack let Will escape and gave him the compass to let Beckett find Shipwrek Cove where final battle took place.