As an aside, Hopkirk, this decision was not imposed by the EU, but was the result of a ruling by the European Court on Human Rights (ECHR). Leaving the EU would not prevent similar rulings. To avoid that we would have to repeal our own Human Rights Act of 1998 and withdraw as a signatory to the ECHR (the result of which would probably see our expulsion from the EU anyway). However, I digress.
To go to prison in the UK you either have to commit a serious offence, or a series of less serious offences, or deliberately defy a court order (for example, refuse to pay fines or complete a community order). So the question that needs to be asked is should people falling into the above categories be afforded the same rights to choose an MP or councillors as those who have not transgressed?
My own view is that they should not. In particular they should not be allowed to vote in local elections as the population of a reasonable sized prison can skew the results of a poll so that the wishes of the indigenous electorate are affected by the votes of a largely transient population who are unlikely to have any lasting local interests. A similar argument could be applied to Parliamentary elections though a possible way round this would be for a seat to be created for a “Member for Prisons.”
In practice I think this is a bit of a non-issue as it will affect very few prisoners and of them even fewer are likely to want to vote. But in principle I believe that for the time of their incarceration prisoners should forgo some of the rights afforded to law-abiding citizens.