In fact, Rashi states as much quite explicitly, even though, his statement is usually read in a different way:
10. If you go out to war against your enemies, and the Lord, your God, will deliver him into your hands, and you take his captives, 11. and you see among the captives a beautiful woman and you desire her, you may take [her] for yourself as a wife.
RASHI:
ולקחת לך לאשה: לא דברה תורה אלא כנגד יצר הרע
you may take [her] for yourself as a wife: Scripture is speaking only against the evil inclination. For if the Holy One, blessed is He, would not permit her to him, he would take her illicitly. [The Torah teaches us, however, that] if he marries her, he will ultimately come to despise her, as it says after this, “If a man has [two wives-one beloved and the other despised]” (verse 15); [moreover] he will ultimately father through her a wayward and rebellious son (see verse 18). For this reason, these passages are juxtaposed. — [Tanchuma 1]
The traditional reading of this Rashi is that, in permitting this marriage, the Torah is allowing the soldier to do, what he would likely do anyway because of his evil inclination. His desire for this woman would be so strong, that it's better to allow him to take her in a permissible way.
Perhaps an equally valid reading of Rashi would be simply to interpret Rashi to mean that this captive from your enemy's land is itself the evil inclination. All three segments mentioned by Rashi can be read in this way: the "beautiful captive" is the evil inclination, also the "despised wife," as well as the "wayward and rebellious son."
The evil inclination is not really "evil." It's is our natural, self-centered, animal instinct, which is base, yet nevertheless important for survival. In Kabbalah and Chassidut, instead of good and evil inclinations, the terms used are G-dly soul and animal soul.
The animal soul attracts us, on a base level because of the physical pleasures it can bring us, but on a higher level, for the mitzvoth we can accomplish with it. After all, most mitzvoth are physical in nature, so the physical drives of the animal soul are important to get the mitzvoth done in the best possible way. However, before being able to use the animal soul for mitzvoth, it has to be somewhat disarmed or "defanged:"
12. You shall bring her into your home, and she shall shave her head and let her nails grow. 13. And she shall remove the garment of her captivity from upon herself, and stay in your house, and weep for her father and her mother for a full month. After that, you may be intimate with her and possess her, and she will be a wife for you.
In Judaism, there are proper ways to perform physical acts that constitute mitzvoth. The most common are probably eating and having marital relations in a kosher way, but there are others as well, such as proper commercial dealings, proper speech, etc.
Not everyone in the Jewish people is necessarily required or up for the task of constantly engaging the animal soul to perform mitzvoth.
14. And it will be, if you do not desire her, then you shall send her away wherever she wishes, but you shall not sell her for money. You shall not keep her as a servant, because you have afflicted her.
There is room in Judaism for those that want to lead a more spiritual existence, such as those that wish to lead a life of Torah study. However, the Torah warns that one should not do so "for money." Pirkei Avot states, "Do not make the Torah into a crown with which to aggrandize yourself or a spade with which to dig."
Judaism does not believe in complete ascetism. Some level of physicality will always be present. Still, those that have "afflicted" their animal soul, and chosen not to use it for mitzvoth, will not be able to "keep her as a servant." For these people, the animal soul will not be a very strong tool or aid in their G-dly service.
Similarly, when it comes to the son of the beloved wife (the G-dly soul) and the son of the despised wife (the animal soul), a person must realize that the animal soul is actually the firstborn. The animal soul comes to a person first, much before the G-dly soul. One should not underestimate its importance.
17. Rather, he must acknowledge the firstborn, the son of the despised [wife] and give him a double share in all that he possesses, because he [this firstborn son] is the first of his strength, then he has the birthright entitlement.
Yet, there are aspects of the Yetzer HaRah that have no positive characteristics whatsoever. There are parts of the animal soul that are like Amalek: wayward and rebellious to the extreme, a "glutton and a guzzler." These parts have to be destroyed altogether:
21. And all the men of his city shall pelt him to death with stones, and he shall die. So shall you clear out the evil from among you, and all Israel will listen and fear.
The words in Hebrew for "listen and fear" are Yishme'u veYira'u, יִשְׁמְעוּ וְיִרָאוּ - containing the roots for Reiyah (sight) and Shmiyah (hearing). These in turn are the roots for the names Reuven and Shimon, the first two sons of Jacob.
A question arises as to how the above applies to our patriarch Jacob on a simple level. There is a tradition that our patriarchs were so spiritually sensitive that they kept the Torah much before it was given at Mount Sinai. If so, how is it that Jacob gave the right of firstborn to Joseph, the son of Rachel, the wife he most loved, instead of Reuben, the firstborn, son of Leah?
Comes the Torah and joins the segment regarding the sons of the two wives to the segment regarding the wayward and rebellious son. A son that is deserving of death certainly would not be entitled to anything. There are differences of opinions as to what exactly were the sins of Reuven, Shimon and Levi, but there is one sin that all the older brothers of Joseph committed, which is in fact punishable by death. This sin is also addressed in this week's Torah portion (Ch. 24):
7. If a man is discovered kidnapping any person from among his brothers, of the children of Israel, and treats him as a slave and sells him that thief shall die, so that you shall clear out the evil from among you.
The brothers kidnapped Yoseph HaTzadik (Joseph the Righteous) and sold him as a slave. Rashi explains that there are other requirements for the death penalty, which were not met by Joseph's brothers, such as witnesses and a warning, and treating the person as a slave. Nevertheless, the verse appears to be direct reference to Joseph's situation. By kidnapping Joseph, the older brothers appear to have forfeited their firstborn right. As the Torah itself shows, it was exactly by kidnapping Joseph that the brothers brought upon themselves the very thing they were trying to avoid: Joseph's rule over them.
In fact, we read about this verse on Yom Kippur, in the context of the death of the Asarah Harugei Malchut, the Ten Martyrs (including tzadikim such as Rabbi Yishmael and Rabbi Akiva) who were viciously killed by the Romans. The Roman emperor used this exact verse to justify killing the ten sages. He stated that their death was necessary to atone for the sin of the ten brothers of Joseph.
Let us not wait until Yom Kippur to remember the lessons of repentance and atonement. Let us start today, right now, to tackle our animal inclination, treat our brothers properly, and to attach ourselves to Tzadikim Amiti'im, the true sages, of our generation and of the past. May we then merit to see the true and complete redemption of our people and of the world at large.