There is only one way in which to "repair" your Settlement. You must purchase and equip a Settlement Repair System. This is a very expensive investment but a necessary one.
They can be purchased at any JR Galactic store you may find. They generally range in price between 33-35 million credits. It is advisable to purchase one before you reach level 3 settlement status as this is when the pirate attacks begin.
Note: Another way to increase but not "repair" your HP is to purchase and equip Settlement Armour Packs. These are not as expensive in themselves but they do take up a lot of energy. They also deplete in effectiveness during each attack.
Thus causing the need to purchase more as each attack comes. So these are a temporary fix at best and will be a very expensive route to take in the long run if no Settlement Repair System is ever equipped.