You must have missed the 2008 part, the same year we elected a president who was against gay marriage.
In 2008, the "moderate" position was to support civil unions, while opposing full equality. So that's what Obama did. Now, in 2014, the needle has shifted. Gay marriage has become increasingly mainstream.