[4.23] Forbidden to you are your mothers and your daughters and your sisters and your paternal aunts and your maternal aunts and brothers’ daughters and sisters’ daughters and your mothers that have suckled you and your foster-sisters and mothers of your wives and your step-daughters who are in your guardianship, (born) of your wives to whom you have gone in, but if you have not gone in to them, there is no blame on you (in marrying them), and the wives of your sons who are of your own loins and that you should have two sisters together, except what has already passed; surely Allah is Forgiving, Merciful.
[4.24] And all married women except those whom your right hands possess (this is) Allah’s ordinance to you, and lawful for you are (all women) besides those, provided that you seek (them) with your property, taking (them) in marriage not committing fornication. Then as to those whom you profit by, give them their dowries as appointed; and there is no blame on you about what you mutually agree after what is appointed; surely Allah is Knowing, Wise.
[4.25] And whoever among you has not within his power ampleness of means to marry free believing women, then (he may marry) of those whom your right hands possess from among your believing maidens; and Allah knows best your faith: you are (sprung) the one from the other; so marry them with the permission of their masters, and give them their dowries justly, they being chaste, not fornicating, nor receiving paramours; and when they are taken in marriage, then if they are guilty of indecency, they shall suffer half the punishment which is (inflicted) upon free women. This is for him among you who fears falling into evil; and that you abstain is better for you, and Allah is Forgiving, Merciful.
One has to read all the adjoining verses in conjunction. Verses 4:23 to 4:25 are about women that a man is forbidden to MARRY. Verse 4:24 is about married slave women who had been captured at the battlefield itself and whose previous marriages were made null and void because they were unable to go back or had converted to Islam in captivity and didn’t want to go back to their non-Muslim husbands. Muslim women suffered the same fate when they were captured by the enemies. That is why Quran hints at this and says that Muslim should not grieve over what they have lost. If there was a treaty, the prisoners of war were always exchanged. It is only when there was none, that prisoners of war were taken as slaves. Even so, one month had to pass before a slave woman could marry another man, allowing sufficient time for her family to seek her freedom, if they wanted to. These women were either freed, released on payment of ransom, or exchanged with other Muslim prisoners held by the enemy. Here, Quran is allowing a Muslim man to MARRY from among these women. Verse 4:25 clearly explains this and creates an additional condition that besides the consent of the woman, the consent of her master/guardian should also be obtained. The master/guardian was not always the person who slept with her. This is clearly exemplified in this Hadith: “There are three people for whom there is a double reward; a person belonging to the Ahl al-Kitab who believes in his own prophet and believes in Muhammad, and the slave owned by another when he performs his obligations towards Allah and his obligations towards his master, and the man who has a slave girl with him, that he teaches her good manners and instructs her well in polite accomplishment, and he educates her and gives her a good education, then he sets her free and marries her off.” This tradition is repeated in Bukhari at least six times.
See also Verse 4:19, which says: