It was forbidden to have sex with them until they were distributed and their iddah period was over that's a long time. But this hadith clearly show they decided to have intercourse with them without waiting iddah period.
Abu Sa'id, did you hear Allah's Messenger (ﷺ) mentioning al-'azl? He said: Yes, and added: We went out with Allah's Messenger (ﷺ) on the expedition to the Bi'l-Mustaliq and took captive some excellent Arab women; and we desired them, for we were suffering from the absence of our wives, (but at the same time) we also desired ransom for them. So we decided to have sexual intercourse with them but by observing 'azl (Withdrawing the male sexual organ before emission of semen to avoid-conception). But we said: We are doing an act whereas Allah's Messenger is amongst us; why not ask him? So we asked Allah's Messenger (ﷺ), and he said: It does not matter if you do not do it, for every soul that is to be born up to the Day of Resurrection will be born. -- Sahih Muslim 1438