And taxes are the main income for the state. Your point being?
Especially the sugar tariff is a prime example of revenue generation. It's one of the oldest tariffs in the U.S. and falls straight in the category "tariff anything which has to be imported anyway". When it was introduced, sugar was mainly made from sugar cane, which is a tropical plant and was harvested in the Caribbean and South America, but not in the U.S.. Only in the early 19th century, the sugar beet was slowly introduced as a second source for sugar. The method to extract sugar from the sugar beet was invented in 1747, but only in 1801, the first sugar beet fields were commercially grown in Prussia, and in the 1840ies, the sugar beet was introduced into the Americas. 1879, the first commercial production of sugar beets started in California, and by 1880, 50% of the world's sugar was made from sugar beets.
This means that for at least 100 years, nearly all sugar was imported into the U.S., generating a wealthy income from tariffs to the U.S. government, without any local sugar industry to be protected.
Don't confuse more or less desired side effects from taxes and tariffs with the main goal: revenue!