It's generally legal to buy a gun as a gift, assuming the recipient is not prohibited from owning a gun. That's apparently the scenario here...? My wife has bought me guns, and I have bought her one. No problems, though we don't have "gun registration" in the free state of Arizona.
I have bought guns as gifts and flat out told the dealer it was a gift. No problem, I am still the "actual purchaser" of the gun, which the 4473 asks. If I was buying a gun for a prohibited person with his money, however, I would be making an illegal straw purchase.