Why does it have to be legal?
Under CA Revenue and Taxation Code (R&T) §§ 30101 and 30123, every distributor of cigarettes in the state must pay a combined tax amounting to 87 cents per 20 cigarette pack distributed in the state. R&T § 30008 defines distribution to include the use or consumption of untaxed cigarettes, and use or consumption includes under § 30009 any exercise of right or control over the cigarettes. R & T § 30011 defines a distributor as any one who engages in distribution of cigarettes in the state.
What those provisions mean when you put them all together is that if you bring into or use untaxed cigarettes in CA, you are a distributor under CA law and are liable to pay the cigarette taxes. There are two reasons for this law. One is to protect CA's revenue by ensuring residents don't defeat the cigarette taxes by buying goods from out-of-state. The second is to protect in state sellers of cigarettes from loss of business that would occur if residents can get the cigarettes more cheaply out-of-state by not paying the tax.
By the way, every other state with a cigarette tax does pretty much the same thing.
And why don't they charge the tax for other
goods and services from other states and not
They do, actually, and so does every other state with a sales tax. When you buy goods on which the state sales tax was not collected, the state imposes what is called a "use tax" which is a tax for the privilege of using the item. It is imposed at the same rate as the sales tax. In CA, the use tax is found in R&T § 6201. The purpose of the use tax is the same as the tax on users of cigarettes: protect the state tax revenues and ensure that businesses don't lose business because people are buying in other states to save taxes.
The reason you've not heard about it is that the state has not done much to publicize this tax or a lot to try collecting it up. These are difficult taxes to collect because the state has no cost effective way to find out what all the goods are that you buy from out of state and for which that the seller doesn't collect the sales tax. They do enforce it for goods that must be registered with the state, like cars, RVs, boats, and the like because they know about those purchases when you go to register the items. States are now starting to make greater efforts to get the use tax, but it will take time to develop effective enforcement mechanisms. But understand that you are technically violating the state tax law when you buy goods from out-of-state on which sales taxes weren't collected if you don't pay the use tax on those items.
So, you might be wondering how did they find out about the cigarette purchases when they can't easily get information about other kinds of purchases you make? Well, the states have some help from federal law for that. Under a law passed in the 1950s known as the Jenkins Act (15 U.S.C. § 376), out-of-state tobacco sellers are required to report to the state each sale they make to that state. The state and federal governments have started cracking down on distributors to make sure they comply with this act, and as a result states have been getting more information about these sales and pursuing the buyers for the unpaid taxes.
And why does Calif have the right to collect
taxes on things that were not purchased here?
Because you possessed and/or used the cigarettes in CA, which gives CA jurisdiction to tax you on it. And, as I said in another reply, there is nothing in the U.S. Constitution that prohbits a state from imposing these taxes.