Well you don't, you can keep your companions in your party and leave the settlement without a governor and it will be just fine.
The only time you should leave a companion there is if you captured a settlement of the their culture, making them the governor will give the settlement a loyalty boost. Otherwise there is no point.