Though it is not explained in details, I don't think that it is a plothole.
First of all, Great Britain does not have death penalty, so Eurus has to be contained somewhere. Of course, we know that the British government may employ assassins at time (Mary and her AGRA team for example), but it is unlikely that Mycroft would allow that. Remember how powerful he is in the government ("He is the government" as Sherlock describes him in the first season).
So, Eurus has to be locked somewhere. As explained in the episode, Sherrinford is the most secure prison in the Great Britain. It is not perfect, but perfect security does not exist. And, as in most security breach, the problem is not the technology (the Sherrinford facility) but a human problem. With the precedent of the manipulation of the Governor that lead to his suicide in mind, everybody will follow Mycroft's directives, Mycroft included.
Also, we may consider that Eurus is not a threat anymore. Or at least a lesser threat. Indeed, look at the plot of the episode. She didn't want to have a revenge on Sherlock, or mess with him, but she was looking for brotherly affection from Sherlock in her crazy way. As said in the episode, Sherlock was his favorite when they were children. She got jealous of Redbeard and kind of accidentally killed him. Accidentally because it is clear that the riddle was only a way to play with Sherlock and get his attention. Note that she used the graves with wrong dates that Sherlock loved as a key for her riddle. In addition, the plane game is a metaphore of her situation, estranged from people, and a call for help to Sherlock.
As a sociopath, she is a danger to people, and may harm them. But she now restarted a relationship with her brother, and with her parents, so she is now under control in Sherrinford.