Now imagine that your job isn't merely writing some app but literally about making or breaking world peace, and that your IT department isn't just some tired Windows admins down the hall but the entire disaster that is the same federal government that tried to launch healthcare.gov. And that at no point in your job did anyone even set you up with an official email account in the first place. What would you do?
Both of them broke the law; both of them had very good reasons for doing so. There are arguments that they made Americans less safe by their actions, but there are definitely arguments in both cases that they made Americans more safe by their actions.
And in any case, fixing the email systems for an organization this big is a messy project. There are countless employees who have the existing system set up and have workflows depending on it. There's special handling of classified information, records-keeping, and so forth. All of this will break, somehow, when you try to migrate it. I'm sure Hillary could have chosen to be the meddling exec who demands an IT overhaul to suit her needs if she really wanted to prioritize that, but it does not actually seem like that would have been better for America. (Or for her public perception, for that matter.)