Bonus question: Why do we have it just to sit there and do nothing?
Sorry if this is a stupid question, like I get why we needed it when we had the gold standard but we don't have that anymore so what's the purpose of hoarding it?
William C. Wood wrote a brilliant article entitled 'The Gold At Fort Knox,' which answers your questions (and some more!)
The gold currently in Fort Knox came from melted "Depression-era gold coins, from lend-lease arrangements in World War War II, and from government operations under the gold standard." (p. 343)
Conspiracists have questioned the true quantity of gold that sits in Fort Knox and indeed, how much remains from the era of the gold standard. The reserve was first audited during the Eisenhower administration in 1952, and no irregularities were found, nor were they in subsequent audits by various branches of government including the treasury. Yet, some gold did leave the reserve "at below-market prices late in the history of the international gold standard." (p. 344)
The gold remained because it has been used occasionally (usually for ceremonial purposes) since the abolition of the gold standard, such as a small amount being minted for commemorative coins including "the Statue of Liberty Centennial coin and the American Eagle Bullion Coin." (p. 344)
Interestingly, there are rumours that some gold at Fort Knox was used as part of the deal to free the hostages from the Iranian Embassy in 1981.
Wood notes false rumours about the uses for the gold: it is not used to back the USD, no holder of currency has any claim on the gold and it is not used to settle international payments.
TL;DR - Gold accumulated wealth from sources incl. melted down coins, unknown quantity remains today to mint coins or to be used in exceptional circumstances (e.g. Iran Hostage Siege), but doubtful US Gov. will ever publicly state quantity/purpose of gold.
Source: William C. Wood, "The Gold at Fort Knox," The Journal of Economic Education, Vol. 25, No. 4 (Autumn, 1994), pp. 343-348