I mean, rape was massively looked down upon in the Hebrew scripture, so much so that all of the tribes of Israel warred with the Benjamites for not doing anything about the men in Gibeah. Others have already addressed these points, (e.g., the ending of Judges 21 in which it introduces the fact that God had not commanded their deeds).
It's basically widely known that women didn't have the best position in that culture, especially in consideration of it being a 'purity' culture. Rape, then, would have ruined the woman's life, especially since lying does exist, and many men would be wary of that, even more with the sexual diseases the Israelites would have experienced (such as the one recorded in Numbers). But it's also because of this fact that rape takes an even wider negative outlook for persons.
In Genesis 34, Jacob's daughter, Dinah, was raped by a prince named Shechem who had become infatuated with her. This deeply angered Jacob and his sons, which eventually led to his sons massacring all of the males in the city after Jacob had the king (whose intentions were to marry Dinah with his son Shechem) circumcise them. In Judges 19, a concubine is gang-raped until morning and dies, which upsets her husband and all of the tribes, issuing a war between the tribes and Benjamites (the event I mentioned earlier).
In Deuteronomy, there is a ruling on female captives.
When you go out to war against your enemies, and the Lord your God hands them over to you and you take them captive, suppose you see among the captives a beautiful woman whom you desire and want to marry, and so you bring her home to your house: she shall shave her head, pare her nails, discard her captive’s garb, and shall remain in your house a full month, mourning for her father and mother; after that you may go in to her and be her husband, and she shall be your wife. But if you are not satisfied with her, you shall let her go free and not sell her for money. You must not treat her as a slave, since you have dishonored her. (Deuteronomy 21:10-14, NRSV)
Putting aside, first, the overall substance of what the verse is conveying, the key issue here is that God does not allow sexual activities outside of marriage as observed as an example here. It couldn't be done while she mourned and it couldn't be done until they married. Adultery and fornication were both equally punishable. The Israelites knew fully the significance and holiness of marriage. Additionally, they also knew the rights and privileges granted to someone that became a wife.
"Sex slaves" were never really sex slaves. Concubines were functionally wives. The concubine in Judges, mentioned above, even left her husband and went to be with her father for an extended period of time due to a conflict between her and her husband. If she had been a slave without a wifely capacity, her husband could have told her not to; however, he couldn't and didn't, forcing him to go and make amends. Even women given by their fathers as 'slaves' weren't leaving to be a slave, but to be a wife.
When a man sells his daughter as a slave, she shall not go out as the male slaves do. If she does not please her master, who designated her for himself, then he shall let her be redeemed; he shall have no right to sell her to a foreign people, since he has dealt unfairly with her. If he designates her for his son, he shall deal with her as with a daughter. If he takes another wife to himself, he shall not diminish the food, clothing, or marital rights of the first wife. And if he does not do these three things for her, she shall go out without debt, without payment of money. (Exodus 21:7-11, NRSV)
A notorious passage directly relating to whether God condones rape is in Deuteronomy 22:28-29.
If a man meets a virgin who is not engaged, and seizes her and lies with her, and they are caught in the act, the man who lay with her shall give fifty shekels of silver to the young woman’s father, and she shall become his wife. Because he violated her he shall not be permitted to divorce her as long as he lives. (Deuteronomy 22:28-29, NRSV)
This, definitely, does appear to be punishing the woman, but this isn't a standalone verse, either. Relatedly, the alternative option is the money being accepted, but there being no marriage.
When a man seduces a virgin who is not engaged to be married, and lies with her, he shall give the bride-price for her and make her his wife. But if her father refuses to give her to him, he shall pay an amount equal to the bride-price for virgins. (Exodus 22:16-17)
If God looks down on rape, why would he allow it in general? This relates to culture. Most people except the cities morally depraved looked down on rape. Fathers, especially, as they raised their daughters and recognised the damage rape could issue. Not all did and, unfortunately, offered their daughters to be gang-raped instead of their guests. I wouldn't say these instances exemplify biblical values (and that's not a matter I would speak of as an atheist myself). However, this does illustrate that the man is now obligated to take care of her for the rest of her life if her father is unable to find a husband that would marry her despite not being a virgin. Should she have no one familially to take care of her after her father's demise, the subsequent result would have been prostitution or something similar. Marriage to a rapist, while undoubtedly being painful, would have been a result when others were exhausted; even more, it'd be a result to minimise the amount of damage done to her long-term. She now had to be taken care of for the rest of her days.
Since he could not divorce her for "as long as he lives," he now had to support her even if she committed deeds that made her sexually indecent.
Rape would be considered sexual immorality based on the regulations concerning sex and marriage.