—Each tax is different. Some are good, some are bad. Some have negative effects that outweigh the good. You need to be specific.—
A better way to think of it is to separate the taxes from the spending they finance. From the viewpoint of cost-benefit analysis, the taxation itself isn’t necessarily good OR bad: it’s just a transfer of income from one person to another. What the money is later spent on doesn’t make the TAX any better or worse in terms of efficiency or fairness.
What can be bad about some taxes (most realistic taxes) is that they are inefficient: they cause people to undertake wasteful activity to avoid the tax (whether illegally, or, more devastatingly: legally). When taxes increase the price of shirts, less shirts are bought, and people have less shirts (or no shirts if they can no longer afford the shirts). That’s a real and tangible loss of social welfare. The only kinds of taxes that don’t have this sort of inefficiency (automatic costs) are head taxes: those that cannot be avoided. If I tax food, you might end up buying less food. If I, however, tax some immutable trait, like citizenship, gender, or race, there’s nothing you can do to avoid the tax.
However, since head taxes are usually unacceptable to most people, we are left with the reality that just about any non-Pigouvian tax you levy in the real world comes with associated costs. (Pigouvian taxes are a little different, because they supposedly correct some externality (though often in a rather inefficient way), which can be a real benefit of enacting the tax. However, the tax ITSELF, by which I mean the taking of the money, is still neither good or bad: people too often think of the tax revenue as “free money” or a double good. But money out of one person’s pocket and into another’s is not itself necessarily good or bad. The corrected externality is the good done, not the revenue taken by the tax (which is in most cases in excess of the amount of social good the tax does)
Now, that’s the taxation. The spending is a whole different ball of wax. It can be really well spent, or really foolishly wasted. The question is whether the benefits of spending can justify the potential costs of taxation (which, since I forgot to speak about them before, include all sorts of related costs like wasted time and money on collecting the tax, chasing down cheats, people spending time on confusing paperwork, etc). Keep in mind that these benefits can’t JUST spend the money on something of fair value to break even: they have to do so in a way that provides more benefit than there otherwise might have been had. Usually the most justifiable spending, in terms of benefit, is one that helps solve yet another externality, usually by providing public goods.
And, as I noted, that’s not even getting into the question of whether it’s RIGHT to tax to fund certain things, just because you think there might be some overall benefit. Not everyone is a classical untilitarian.