This is not a moralistic set of rules - they say nothing about someone's behaviour, whether before election or afterwards. The Representation of the People Act 1981 changed the law so that anyone imprisoned for more than a year in the United Kingdom or the Republic of Ireland was disqualified. If sitting as an MP when sentenced, then they ceased to be an MP and a by-election was held. If they were in prison when elected then the election is "void", in which case a by-election is held.
We do not ban candidates and/or parties, but now Crossbench peer Gus O'Donnell has suggested that candidates should be "vetted" before being allowed to stand.
No doubt this will be lauded as preventing extremists from standing, or ensuring a better quality of candidate, but this should send shivers down any democrat's spine. To prevent people from standing for election has no place in any democracy.