I imagine abolitionists could see how we fought pirates for slavery while literally having slaves would be nice political fodder. Cartoons, maybe?
The impression of sailors was not an exclusive activity of the Barbary States, neither were acts of holding hostages for ransom. Although this issue was a concern for the American government, it's an oversimplification to say we went to war with Algeria, Tunis, and Tripoli over the capture of American sailors and merchants. It ignores the larger reasons surrounding this conflict.
The bigger issues involved the disruption of lucrative American trade in the Mediterranean, America's standing in the world, their ability to protect their trade, and the growing debate about whether to fund a permanent navy or not.
The very young government of the United States was not only figuring itself out but it was a junior member on the diplomatic scene. Whereas the great powers and the major powers like Great Britain, France, and Sweden, had the treasury funds to pay off the pirates, the Americans often did not. I, personally, speculate that it would be of interest for the great/major powers to continue this system of paying ransoms to encourage their own merchant vessels to get passage while hampering the smaller competitors that couldn't pay, like America. It didn't make financial sense for the great/major powers to use their navy against the people who were effectively regulating the Mediterranean trade in the favor of the greats and majors. I don't believe this analysis was put forward in the books I'm sourcing, but it makes enough sense to me from my readings to make mention of it.
The loss of income from this trade, the protests by merchants and the families of captives, put a lot of pressure on the young American government to solve this problem. One issue was whether paying the tribute was worthwhile compared to the loss of trade (it was but not at the usurious prices quoted to Americans, which was often much higher than those tribute prices offered to the great/major powers), or whether raising a navy for a military action would exceed in cost the gains from protecting this trade. Many including, Thomas Jefferson, and John Adams, agreed that the tribute was excessive, and exceeded what America had in the Treasury, and agreed that the cost of a navy would not exceed the gains from protecting the trade. A military action with the navy was becoming the prevailing solution.
The next issue then became was whether to having a standing navy or a temporary navy to solve conflicts as they arose. Both sides had strong arguments and up to this point the side against a standing navy had the right of way. There was a compromise solution floated for keeping a fleet of small gunboats that excelled in shallow, coastal waters. Part of the reasoning for this idea was that quantity would prevail over the quality of larger ships (and be more cost effective), and for many in the anti-navy lobby it also meant that the United States was less likely to use their Navy for overseas adventures (isolationism was a prevalent and significant idea in this time period for America). One of the primary arguments against a permanent navy was not only the tax that would have to be levied to maintain it, but also the belief among many that the United States had no need for a navy because it should never be involved in that capacity in foreign affairs.
The pro-navy lobby won, and luckily the gunboat idea was axed in favor of larger warships. Six Frigates were commissioned to make a small but powerful standing navy. The driving force for this decision was making the Barbary pirates pay for their transgressions, getting prisoners released, allowing leverage for ransom payments, and projecting power on the world stage.
The long story short is that through several efforts not only did the Navy effectively ward off the pirates, it showed enough firepower in naval bombardment, coupled with land invasion using local mercenaries, to get American hostages freed, and to get tribute-less terms for free passage (this is not entirely true, there is a notable bungle by an American diplomat that caused America to pay once at the end of the conflict when it is believed the Tripoli ruler had no choice but to accept terms without a ransom payment, the story is in the Jefferson book.)
The story of the Barbary Coast wars is absolutely fascinating, riveting, and I think incredibly underrated in American history. It was the birth of a standing Navy, it was the first showcase of American might in world affairs, and the young America effectively ended state-sanctioned piracy in the Barbary Coast using military force. Some of the details include incredible heroism, incompetent bungling, and overall fascinating insights into people and governments.
The books that I'm sourcing these facts and ideas from is Six Frigates by Ian Toll, and Thomas Jefferson and the Tripoli Pirates by Brian Kilmeade, both are interesting and exciting reads. I highly recommend them to the history buff.