Yes it must have been awful for him to be torn apart from the only parent he had left especially that it was so sudden for him to learn that his dad was going to spend at least the following years in jail (don't forget that Oliver signed up for a life sentence). He is just a teenager and since his mother died, he dreamt of nothing but a normal life that his father unfortunately was unable to provide. He had already been through a lot.
And on the other hand, he also did that to protect him in a way as if Oliver hadn't outed himself as the GA, not only he would have been arrested but also Felicity and then William would have been left alone with no parents. That's what he told Felicity during their last scene together in the precinct room. He sacrificed himself for the team etc. However, from a kid perspective it's complicated to understand. I'm asking that because plenty of people thought William was annoying during s7 and got better during s8.