I believe that he was correct to condemn those who had turned to culturally inherited deviant rituals and a traditionally controlled legalistic "religion" (like the jews had done with the guidance given through Moses) which had no good relationship with Quran and intellect, and most of us probably know that the ottoman hereditary kingdom had lost touch with Allah.
Being driven out of a place for strong opinions is not necessarily a sign of deviance - since it was something the Prophets went through. And if he was disliked by people for cutting down trees which the people had started to go to pray to - it only shows their own deviance.
He appears to have done a "you scratch my back and I'll scratch yours" compromise with others who needed him for his influence, and who he appeared to feel he needed for their tribal backing - this is sometimes done if the intentions and calculations are correct according to circumstances (yusuf
in egypt) with the aim of pleasing Allah and making a bad situation better, but sometimes dangerous - especially when the people with whom the deal is being done are treacherous.
Allah knows best.