means that
wealth or other desirable gains may not be worth the sacrifices required to obtain them. Dear here means costly.
When sometimes it is not worth having wealth if there is too big the risk in acquiring it or if you have to sacrifice something dear -like your…, the saying “Gold may be bought too dear” is appropriate.