The first states to legalize recreational cannabis were Washington and Colorado in 2012. Both states approved ballot measures to allow adult possession of cannabis and regulated commercial sales, with Washington implementing sales starting in 2014 and Colorado in 2014 as well.
For medical cannabis, California was the first state to legalize it in 1996 with Proposition 215.
So, for recreational use specifically, Washington and Colorado were the pioneers in legalizing weed in 2012.