They could have given them a choice. They didn’t have to leave if they didn’t want to.
Plus, isn’t diverting that meteor also breaking the rule? By that logic they should have let them all die.
That's TNG's ridiculously over-literal version of the PD. Kirk thought nothing of saving those transplanted Native Americans from an asteroid back on TOS. This was a similar situation.
There's a difference between not contaminated their culture and covertly keeping them from being obliterated.