Why is it not grave robbery to take artefacts from ancient graves and put them in a museum? - eviltoast

As I was reading about the Valley of the Kings again, I wonder why that was actually legal.