The idiom “as good as gold” originally referred to something that was real and genuine. In the past, business was conducted using a document that promised payment within a certain amount of time – a credit note. Some customers paid on time but others delayed payment or used forged credit notes to avoid paying altogether. So many business owners preferred being paid in gold/silver, which was real, tangible and immediate.
The current meaning shows a shift to something that is genuinely good – we speak mainly of a child being “as good as gold”.
At the other end of the spectrum, “the bad” and specifically the devil hides behind many sayings: “as ugly as sin” (meaning hideous looking) was first recorded in 1801 replacing the original “as ugly as the devil”. And to “play devil’s advocate” meaning to argue an unpopular view or one the arguer doesn’t necessarily believe in, (to provoke debate or test validity of the opposing argument) also has religious origins. It’s a translation from the Latin advocatus diaboli, the popular title given to the Catholic Church official who has to present arguments against the proposed canonisation of a saint. Typically, the official would be proposing a view he didn’t agree with to ensure the right decision was made.