The Bible clearly commands Christians to separate from the immoral and heretical.
That separation must take place in a proper manner, of course - which the Bible regulates. It's not the work of ten minutes, or based on the arbitrary declarations of private Christians. Sin must be brought to the church, and dealt with patiently and prayerfully there.
Sometimes the church refuses to deal with it, and then Christians must separate from the church. Or churches within a fellowship (denomination, organisation, etc.) must separate from that fellowship, if it refuses to deal seriously with sin.
For many years now it has been clear that certain denominations, including the Church of England and Church of Scotland, as a whole not only refuse to deal with certain obvious sins and false doctrines (such as sodomy and feminism), but that they actively promote them. The main ruling bodies of those denominations not only won't discipline anyone for promoting them; they actually approve of them. They have a few dissenters, but that's their settled position in the main, as shown by the decisions they hand down.
It's sad when evangelicals remain, to this day, so blind to this reality and manufacture endless excuses as to why their Biblical duty does not apply, or can be infinitely postponed. When they come out with preposterous nonsense about how the CoS or CoE each remain a "Reformed evangelical church", because there's some centuries-old paperwork that says so (or at least, it said so centuries ago). (Just like the Pharisees were all faithful Israelites because they sat in the seat of Moses... that's not how Paul or Jesus assessed them, is it? Is the Reformation Roman Catholic Church to be judged as basically Reformed or evangelical based upon the writings of Augustine etc.? Totally absurd, isn't it?). They come up with unending reasons why a body, such as the CoS, should still be considered a "faithful church" which they can remain joined with in good conscience, despite its refusal for generations to take a clear stand on that which actually defines a church - namely the gospel. Then they are surprised and wounded when the non-church actually behaves like one...
It's embarrassing when you end up with the unfaithful forcefully evicting the gospel believers who refused to face up to these unpalatable, awkward truths. When the non-church which took over the organisational structure so many moons ago finally evicts the remnants of the church who refused to face up to what was happening, the church acts as surprised, and cries foul. Oh dear! The "Tron" is full of people much better and much more fruitful than I. But if they invested millions of pounds in the CoS's building, whilst perpetually ignoring the Scriptural warnings, refusing to read the signs of the times and paying no attention to the implications of the red skies in the morning. At last the inevitable is arriving. Now that it is doing so, are they actually suffering for the faith, or just facing the very predictable consequences of their own refusal to practice Biblical separation and lack of wisdom? Should we honour their courageous stand, or shake our heads at their lack of Scriptural discernment and folly in investing so much time and effort in improving the facilities of a ship which was long holed below the water line and already tilted towards the ocean's bottom?
I note from that above link that the minister now fears being evicted from "their" manse. My dear brother, whose ministry has blessed thousands for every one that mine has blessed, wake up!