In some cases this was to restore buoyancy to compensate for wartime weight additions, as well as for torpedo protection.
In certain instances, this was done to re-establish buoyancy in order to counter wartime weight increases, as well as for torpedo defense.