Every market has a job.
The bond market’s job is to price what a dollar will be worth years from now
A much older market exists to price what happens when that first calculation turns out to be wrong. Most of the time, the two take opposite sides of the same bet. When the Federal Reserve looks serious about inflation, Treasury yields climb and gold gets sold.
The logic is not complicated. Gold pays you nothing to hold it. So the higher the interest a government bond offers, the more expensive it becomes to own a metal that just sits in a vault earning zero.