Before Joseph died in Egypt, he exacted a promise from the sons of Israel that when God visited them to deliver them from bondage they would carry his bones from Egypt. Upon his death he was embalmed and placed in a coffin in Egypt (Genesis 50:25-26). This is what we would expect in Egypt.
The request regarding his bones manifests an understanding of the promise that the LORD would give to the descendants of Abraham the land where Abraham dwelt (Genesis 15:13-16). It also manifests a strong faith regarding the fulfillment of that promise.
Moses took the bones of Joseph with the Israelites when they fled Egypt. This was the strangest thing one can imagine — transporting the mummified body of Joseph through forty years of wilderness wandering.
Moses took the bones of Joseph with him, for Joseph had made the sons of Israel solemnly swear, saying, “God will surely visit you, and you shall carry up my bones with you from here.” (Exodus 13:19 ESV)
Eventually, Joseph’s bones were buried at Shechem.
As for the bones of Joseph, which the people of Israel brought up from Egypt, they buried them at Shechem, in the piece of land that Jacob bought from the sons of Hamor the father of Shechem for a hundred pieces of money. It became an inheritance of the descendants of Joseph. (Joshua 24:32 ESV)
The building pictured above is a fairly recent structure that is called the Tomb of Joseph. Jewish settlers come to the empty building, now within the Palestinian territory, frequently. Sometimes fights erupt. One of the recent clashes is described here.