I agree with Milica who put it very succintly. Even as a consultant, a culture fit is very important. Most people assume that this is reserved for employees only. As a consultant, if you've been brought on board as an "expert" in a field, then they would do well to take your advice. Disagreements are normal, but if you're this unhappy about it, walk away. No shame.
Having said that, there are times in the past where I've disagreed with the client but still went ahead and did what they asked for. In those scenarios, it's about covering your own ass first. I'd make my disagreement with their final decision in a written format to ensure a paper trail to the saga. At the end of the day, it's their product, their company and their team. It's up to them how to run the show. I was there to help in any way I could. If all they wanted was a pair of hands, that's all they get. If the client actually wants a brain to go with it, I'd be happy to oblige, but I'm not killing myself over it. Obviously I never renewed their contract.