Despite the fact my E9 have "matching numbers" not for every car it bring any value.
Most of motorsport cars have had many engines (and even bodies) so this is not the case for consideration.
BMW E9/E3/E10... is kind a car which is expected to enjoy the User driving it.
For many historic cars or low mileage ones it might bring some value as a mark of originality. On the other car someone who would like to drive might be happier having newer, fresh engine than original but weak and worn.
For some countries engine number was required to be in the registration ID. It was done from few reasons but it is problematic at some point for the user. Many shops were good at stamping numbers on the body or engine (fraud, stolen parts etc.). I'm pretty sure some countries are still recording engine numbers next to chassis one.