To be fair, it is highly likely he was lying and was saying that just to ensure he could win the election.
A modern example would be Obama saying in 2008 that he wasn't in favour of same sex marriage.
Source:https://www.politifact.com/factchecks/2012/may/11/barack-oba...
There are many other sources. Biden was saying the same thing in 2008.