It happened, but it wasn't a legal marriage for much of the 19th Century.
Marriage with a dead wife's sister was forbidden by the table of affinity within the church of England However, these marriages did take place and were legal but voidable as they shouldn't have taken place in the first place. They were often challenged by relatives and of course, one partner could decide 20 years later that they no longer wanted the marriage A marriage could be voided on a death bed! If a marriage was voided, all children were made illegitimate
After a law passed in 1835 which was supposed to resolve the problem, any such marriages that had not been annulled were deemed to be valid but any that took place afterwards were deemed to be void . There was no criminal penalty (unlike bigamy) Any children were illegitimate. The 'wife' often suffered in law when the 'husband' died and wills not carefully written were challenged. It also meant that the couple were 'living in sin' and might suffer social exclusion. At the lower end of the social scale, such relationships might mean that charity was not granted or if the relationship lead to domestic violence the woman might be less sympathetically treated by the courts.
It was however, an extremely controversial. Quite often, sisters were called upon to look after young families when the man became a widow. They often became close and wanted to marry. It could also be considered to be immoral for the two of them to live in the same house unmarried. The bible of course supported such a marriage. The prohibition became more controversial over the century. There were lots of letters to the Times and several bills introduced in parliament but of course Anglican Bishops were members of the House of Lords. Marriage to a wife's sister continued to be illegal until 1807.1907 (typo)
(there is an article about the case of Jane Austen's brother who married his deceased wife in1820 and her niece who 'married' her dead sisters husband in 1850 http://www.jasna.org/publications/persuasions-online/vol36no1/bailey/ (