As fuel is pumped out of a tank, water is pumped into it. Since the two don't mix, it's not an issue of contamination. And yes, it's a ballast/safety issue, if the tanks aren't filled the ship can mess up it's center of gravity, and if I remember a half empty tank can be somewhat of a...