If a native speaker wrote that, I’d take it as a rhetorical question, very similar to, “The reason someone wants to learn a second language has nothing to do with this course. Isn’t that correct?” It’s something I might say if I didn’t want to answer a personal question, and didn’t care about being polite.
But it really depends on how you say it. If you emphasized the word does, making the question, “What does the reason we want to learn a second language have to do with this course?” it sounds more like a sincere question: “I believe you that these two things are related, but how?” Emphasize the word this, before course, and the question is asking, “There is another course where that question would be more appropriate, isn’t there?” Emphasize the word foreign, and the person is wondering why he or she is being questioned specifically bout learning a foreign language. And so on.
There are several different things the person could be trying to say, and it can be difficult to tell which one the other person meant.