I think it's pretty typical for childrens' allegiance to change from time to time and to intensify at times. I don't think it means a single thing about your parenting.
Since he is 2, it may be that he is developing his sense of himself as a boy (younger kids don't really differentiate) and is modeling himself after his father. Totally natural.
It could change again in a month, or in a year. Don't sweat it!
I'm also of the opinion that moms are the more constant parent in many cases (home more, more likely to be the nuturing one) and thus the kids are more comfortable and confident around her. This, unfortunately, translate into more bad behavior with mom and more often taking her for granted. Not fair, but it seems true in many cases.
"All you have to decide is what to do with the time that is given to you."
I struggled with the lack of "attention" my step-son afforded me until I read a book by Dobson "Bringing Up Boys" (some chapters better than others) and I read that boys around 2 or three start preferring their fathers over mothers as they begin to define their gender roles. My step-son was not allowed much visitation by his father when he was very young because his ex-wife used the children as a bargaining chip and have now realized that he is clingy with his father maybe in an attempt to "find" himself as a man. I have to laugh at Pre-Med RN's post because we engage in a simialr game with kiddo-I always bring him a can of juice or candy from the vending machine after work and I'm the favorite parent for a ten block commute and in those rare times of punishment there is always the game of good-cop/bad-cop.
I went through a similar experience when my first son was one. My husband began a sports med fellowship and I stepped up to working full time with inpatient/weekends/call/the whole thing to support the family. Until that change, I had been the 'preferred parent' who spent more time with him, but afterwards, our son began preferring Daddy! This was hard for me to take emotionally on top of already being exausted from working over 80 hours/week. Looking back, at this tender an age, it really is a matter of 'what have you done for me lately.' I wasn't around much to take him to the park, and when I was home I was often tired and cranky from working too much and taking too much call. Happily my miserable year last only 12 months and then I switched jobs and found a part-time one more to my liking. My now almost 6 year old son has a pretty healthy relationship with both of us.
I think it's easy to read too much into your current situation, but take heart in knowing things will get better!
The kids do bounce back and forth for the favourite parent, sometimes in our house it is actually a relief when one switches to my hubby, but the wind will blow the other way again, just try and keep some non grumpy non fatigued time to be silly and fun with your little one and you will see the change!