Revenue into the U.S. Treasury during that time frame came substantially solely from customs duties. So to the extent trade was brutalized by the pirates, customs duties fell. The military expenditures were justified once the political decision was made (basically beginning with Jefferson) that the U.S. was bloody well sick and tired of paying monetary tribute to the mercurial Beys.
“Revenue into the U.S. Treasury during that time frame came substantially solely from customs duties.”
Every major city on the east coast had a Customs House-usually a very well built city.
After the Eire Canal was built, New York City became the largest city in the USA. That canal reduced transportation costs by as much as 90% for many products. Both intranational and international trade expanded because of the canal.