In the United States, the several states each "have broad authority to enact legislation for the public good", often called the "police power". Bond v. United States, 134 SCt 2077, 2086 (2014). "[T]he [state] legislature may forbid or restrict any business when it has a sufficient force of public opinion behind it", subject to express constitutional limitations and subject to federal preemption. Tyson & Brother v. Banton, 273 US 418, 446 (1927) (Holmes, J, dissenting), dissenting opinion approved by Olsen v. Nebraska ex rel. Western Reference & Bond Assn., Inc., 313 US 236, 247 (1941).
As the above authority illustrates, it is not controversial that states can regulate businesses.
For federal constitutional purposes, a city is basically an administrative agency of a state. A state can delegate its police power to a city. Hunter v. Pittsburgh, 207 US 161, 178 (1907) ("Municipal[ities] ... are ... convenient agencies for exercising such of the governmental powers of the State as may be entrusted to them."). It follows that a city can regulate businesses, if delegated such power by the state.
The question of whether your activities are within the scope of the city's licensing program will depend on municipal and state law. In particular, you would first analyse whether the city's bylaws require you to obtain a licence. Next, you would analyse whether or not those bylaws are intra vires the city (i.e. whether the state has actually delegated the city the power to enact those bylaws). Finally, you would analyse whether the state laws are unconstitutional or federally preempted (although neither of those is likely to be an issue on this topic).
Your post does not contain enough information to carry out any of these analytical steps, given that you don't disclose the city in question (and the factual description of your activities is pretty vague).
The Internal Revenue Code does not purport to be a comprehensive code of business regulation. The federal tax treatment of your activities is not necessarily predictive of how those activities are treated by state and municipal law.