In Egypt gold and treasure was buried in tombs because it was believed that the Pharaohs would need it in the afterlife. When a Pharaoh was buried, slaves or servants would also be killed in the tomb as well, with the belief that they would serve the Pharaoh in the afterlife.
Hope this helps!