They're too close together to keep secrets, keeping it to themselves until the final day was a mistake.
They could came up with some other option or Hatsuna spending the time by doing things and not dieing with regret not doing things...
Hatsuna weren't afraid of dieing since now thanks to her magic, even if Institute was hunting for her it was still blissful, but knowing for sure she will die would be overwhelming if one didn't really experience it fully.