Privateering is a tool of international conflict
Read wikipedia; until forbidden by international law, privateering was a tool of international cold war.
France encouraged the corsairs against Spain, and later Britain and Holland supported them against France. By the second half of the 17th century the greater European naval powers were able to strike back effectively enough to intimidate the Barbary States into making peace with them. However, those countries' commercial interests then benefited from the impact of continuing attacks on their competitors, and as a result there was little interest in imposing a more general cessation of corsair activity.
The snarky answer
Because I assumed that the OP had done the basic reasearch, I didn't consult wikipedia until I had to answer @Schwit Janwityanujit's comment. Consequently I drafted this answer, which I'll leave intact.
Why should they? The Barbary Pirates were a protection racket; if you paid tribute, you were not attacked.
After the United States won its independence in the treaty of 1783, it had to protect its own commerce against dangers such as the Barbary pirates. As early as 1784 Congress followed the tradition of the European shipping powers and appropriated $80,000 as tribute to the Barbary states, directing its ministers in Europe, Thomas Jefferson and John Adams, to begin negotiations with them. Trouble began the next year, in July 1785, when Algerians captured two American ships and the dey of Algiers held their crews of twenty-one people for a ransom of nearly $60,000.
Thomas Jefferson Papers
Wars cost money. If the fee charged by the Barbary Pirates for their protection racket is less than the cost of the war, and if you're suffering from the Seven Years War (which arguably was the first world war), and seeking to build an empire in the face of active competition, why not pay the price? Tribute is cheaper.
Also note that large, powerful nations were immune. The Barbary Pirates were smart enough not to molest British ships, nor those of nations allied with France. The United States however was an ideal target - small, heavily in debt, on the verge of war with Britain and lacking a blue water navy able to project power.
Sadly, in this case, the calculations of the Barbary Pirates were flawed. They were the first in a long line of people who made the fatal flaw of underestimating the U.S. Marines.
update: I've had to retract an earlier statement I made here; Jefferson supported a stronger navy
After all, as Thomas Jefferson had once observed, "a naval force can never endanger our liberties, nor occasion bloodshed; a land force would do both";2 or, as James Madison would argue in favor of ratification of the Constitution, a navy could "never be turned by a perfidious government against our liberties." "The Federalist Number 41," in The Papers of James Madison, edited by William T. Hutchinson et al., 17 vols. to date (Chicago: University of Chicago Press, 1962-), 10: 395.
The pro-navy side was strengthened when the President sent documentation supporting his view that a navy was essential, * history.navy.mil
Aside: I believe the situation was more complex than these quotes indicate but Jefferson's ideological committment to utopian Republicanism is outside the scope of this question.
England was emphatically not the only power safe from the Barbary Pirates - Portugal's navy suppressed the pirates.
In 1793 Portugal, whose navy had been keeping the Algerine corsairs within the confines of the Mediterranean, signed a truce with Algiers.
And from wikipedia
In addition to seizing ships, they engaged in Razzias, raids on European coastal towns and villages, mainly in Italy, France, Spain, and Portugal, but also in Great Britain and Ireland, the Netherlands and as far away as Iceland. The main purpose of their attacks was to capture Christian slaves for the Ottoman slave trade as well as the general Muslim market in North Africa and the Middle East. *http://www.bbc.co.uk/history/british/empire_seapower/white_slaves_01.shtml#two*