I totally get what you're saying Daniel, but I see that kind of stuff in training as different than competing, don't you? The way you described the benefits are more like what you get in freestyle training. You ask for challenges from your practice partners and they work with you (even if that is "against" you, right?)
But then the whole emphasis shifts, doesn't it, when the purpose of the activity is to see who is better?
Have you ever had a practice session in any sport where part of the time is spent working together as a team or as practice partners and part as scrimmaging, bouting, matching, etc.? In the situations I've been in (fencing mostly) the whole attitude shifts. Your practice partner who used to help you see your weaknesses so that you can strengthen them is now out to exploit them. This is inherent in the nature of contests.
If there is a "wrong reason" for competing (and not saying there is), might it not be because it encourages the exploitation of weakness for the sake of pride/winning? Is that what you meant by "the wrong reasons?" Or was it something else? More about "ego" maybe?
I suppose I take the view that competition is a method of training, a means of improvement. Even when you are just in the dojo "training" in perhaps hard randori with a partner who is strongly opposing you, exploiting your weaknesses etc, it is still generally not quite as hard as when in an actual competition. However, it is still extremely beneficial.
Even if students enter into competitions for the "wrong" reasons e.g. ego, to win trophies etc, then there is still a reasonable chance that with more study, experience or mentoring by the instructor, they will ultimately change for the better. By then, they would have also improved their skills as well due to the competitions, so not only has their character been changed for the better but their skill level is higher.