Why does the name of the w-2 affect the amount of my return?

I noticed that one of the W-2s was assigned to my wife's name and when I changed it to mine, my fed tax move from a refund to liability - but the dollar amounts are unchanged.  If we're married filing jointly, why does the name make a difference when it is the total income that is calculated?