If the object of this is just to buy somebody a co-author credit without doing the work, that is obviously unethical, but for me that would be one of the least worrisome scenarios...
By academic convention, all co-authors must agree to the content of a paper published under their names. If you make a binding commitment to co-authoring with Bob Corporate without agreeing on the parameters for what is to be published, that puts you in a very precarious position.
Suppose Bob wants the conclusion to say "Our findings show that smoking is beneficial for children's health, and should be made mandatory", and refuses to sign off on any text that doesn't contain that statement. Does the contract then require you to refund their money if you (and the reviewers) can't agree with Bob on what to publish?
But in my experience from a previous career in research, it's not so much the blatant stuff that's a problem. It's the subtle pressures: you have two options for data analysis, both defensible, but Bob wants to use the one which (by coincidence) happens to make your sponsor look better.
The pressure doesn't even need to come from the sponsor. In my case, I never felt any direct pressure from our funders, but I felt considerable pressure from within my institution to produce results that were favourable to our sponsor. When somebody is paying you money, it's only natural to want them to feel like they got their money's worth, especially if you're hoping for repeat business. Nobody needs to say anything out loud, they don't even need to acknowledge to themselves that they're biasing the work. Human beings are fantastically good at finding ways to rationalise choices that happen to support their own interests.
As Sascha's commented, purity is difficult to attain in academia; it's hard to work without money, and money always comes with strings. But at the very least, you should know in advance what the company is hoping to get in return for their money, and think about whether you have sufficient leverage to protect the integrity of whatever's published with your name on it.
If you do go through with it, make sure that the contract covers how disagreements about content will be handled, and make sure that things like data analysis methods are agreed on in advance of data collection (if relevant to your work).
Also, make sure everything is agreed in writing...