Answer :
Because they believed that everything they were put in a tomb with would end up with them in the afterlife, and the more elaborate their tomb, they would live a more luxurious life in the afterlife.
The ancient Egyptians have elaborated sophisticated beliefs about death and the afterlife. They believed that humans had ka, or vital force, that left the body at the moment of the death. While alive, the ka received its livelihood from food and drink, so it was believed that in order to endure beyond death the ka had to receive offerings of food, whose spiritual essence could not be consumed. Every person had also a ba, the unique spiritual characteristics of every individual, that jointly with the ka formed an akh. Through rituals, priests could liberate the ba so it could join again with the ka in the afterlife, but it was important to preserve the body of the dead, for the ba used to go back to the body every night. For these reasons, it was very relevant to decorate the tombs with ornaments, offerings, and inscriptions of the Book of the Dead, because the ability of the dead person to enter into the afterlife depended on it.