Another would be that he actually laid the groundwork for this kind of action. Obama made pursuing marijuana convictions the lowest possible priority for federal prosecutors and law enforcement officials [0], effectively saying "if states want to make weed legal, the federal government isn't going to do anything about it." After that, a number of states held referenda on legalizing weed, and most passed with broad support. This is the next logical step at the federal level - pardoning anyone who was convicted during that period and taking steps towards changing marijuana from a schedule 1 drug (where it has never belonged) to something more reasonable. [1] No president can fully legalize weed at the federal level, but they can reschedule it based on the actual cost/benefits to individuals and society.
Another more cynical answer is that Obama is black, and didn't want the legacy of the first black president to also be "the one who pardoned all the drug offenders"
[0] https://en.wikipedia.org/wiki/Cannabis_policy_of_the_Barack_...