If it's due to carryover losses, which is usually what this sort of rage bait boils down to, it's not only "legal" but "not wrong." Carryover losses are the mathematical byproduct of a tax system that taxes gains in wealth (i.e. income) but must be sampled annually. It would be completely brain damaged to treat two companies differently that make the same total profit over a fixed period depending merely on the pattern of profits and losses over that period. There would be no value to it other than mitigating misdirected outrage from people ignorant about how taxes work.
Agreed, but, in fairness, the personal income tax contains exactly this brain damage.
If I make $100k in one year and then $10k the next, I pay 19% of it in income taxes, even though I averaged $55k/year which should mean paying 14.6% of it in taxes.
You're right, but this is known to people with lumpy income and they do not like it. There's some mitigation depending on how you depreciate or don't depreciate on a Schedule C (people with this issue tend to be self-employed) or if you have the ability to run your income through a corporation to even it out.
Humans all have basically the same expense structure so taxing revenue makes sense. Corporations from different industries have wildly different expense structures so taxing on revenue would be nonsensical: you would end up undertaxing high profit industries like tech or pharma and massively overtaxing low profit industries like retail.