It mostly has to do with the understanding of bitcoin by the policy and law makers and their personal interests. A lot of people believe that bitcoin is produced out of thin air and therefore has no value and is just a ponzi. Gold on the other hand is not as such, hence it is considered to be legal.
Bitcoin is untraceable and anonymous.And more importantly,Government can contol the supply of gold which is not the case with bitcoin.Another reason,one can use bitcoin directly to buy anything but this is not the case with gold.Gold is a commodity and bitcoin a currency