I have argued that the notion of derosh vekabel schar, learn and receive a reward, should not be taken to mean that certain laws were only given so that we could learn them lishmah. Rather, these cases carry with them particular educational messages, either regardless of, or due to the fact, that will never happen. My explanation of this in the context of ben sorer u’moreh can be found here. I found that Rabbi Nachum Rabinovitch understood this phrase the same way. It is always nice to have some support. This is the relevant passage.
His full discussion is available here.
The fact that these rules appear in the Torah constitutes an important educational measure. “Expound and receive reward”—one who studies these laws cannot fail to be seized by fear and trembling and will almost certainly be so deeply influenced that some of the perversity in his heart will be cured. Continue reading Learn and Receive Reward: An Educational Statement