Here's the executive order. Owning gold was illegal basically because the government said so. (Unfortunately, that's the base reason for things being illegal. Sometimes things are also illegal because they're dangerous or unhealthful or whatever, but mostly stuff is illegal because the government says so. The government is frequently like parents, only more expensive.) The order contained exceptions for coin collecting and so forth as well as a $100.00 exemption for each individual, but basically, if you had gold coins or bullion, you had to turn it over to a bank that was a member of the Federal Reserve System forthwith and they'd give you paper money in exchange for your gold. They paid $20.67 an ounce for the gold and then turned around and set the price of gold at $35.00 an ounce shortly after EO 6102. However, Merkins were not allowed to try to sell their gold to anyone else for what the market would bear. They had to take their gold to the bank window and get paper money at the $20.67 per ounce exchange rate that the government said was OK. Estimates are that the government made about fifteen dollars per ounce of gold on this transaction, so odds are real damn good that they weren't paying a fair market price to their own citizens.
Turn around, bend over the desk and assume an accomodative stance, willya? Uncle Sam wants to get busy.
It remained illegal for Merkin citizens to own large piles of gold (coins or bullion) until the very end of 1974 when Public Law 93-373 removed bans to the trade in gold as a commodity.