This gave us the Citizens United v. Federal Election Commission, 558 U.S. 310, i case on their right to speech or place funds.
I am not a lawyer, I am cynical
Corporations count as legal persons when it benefits them
It goes back to 1886 [1]. Ditching corporate personhood just makes the law convoluted for no gain. (Oh, you forgot to say corporations in your murder or fraud statute? Oh no!)
A corporation has the right to "speech" but if crimes are committed, rest assured it will not go to jail, and neither will its executives, protected by layers of legal indirection of this "person corporation".