How should course content be shared between instructors?
In my opinion: Yes, you should certainly pass over all course material.

My colleague took over a course from another colleague who had left. My colleague know much less about the subject than the one who had left, so putting together a good course was a challenge for him. In theory, he had passed over all course material, but in practice, it was not very well organised, and my colleague ended up having to build it mostly from scratch.

As you have probably experienced, the first time you give a course is by far the most work, because you have to create everything from scratch. It helps enormously to have access to earlier course material. You lose very little by giving away course material. It's probably not publishable anyway — and if it is, passing it on to the next doesn't disqualify you from publishing it as a review or textbook, because passing it on is not a publication.

The only situation I can imagine where it would be problematic is if the person who you pass it on to claims it as their own and incorporates it in a review paper or textbook. But if you have any trust for the person, they won't do that, and it's much better to simply make all the course material available. Probably for the entire world.