Unfortunately for us, that one is 'working as designed'. Ships and starbases get back HP only with the passage of time, and at the moment, there is not a way to send other ships to repair them (at least, not a way that I know of).
Of course, one way to deal with the issue (with regards to space stations) is to make a few ships of your own, and strike their fleets before they attack your station... but I know that I would appreciate it if there was a way to repair damaged ship/bases as well. A way other than 'waiting'.