A weak cervix can give rise to preterm labour. Also, infection of the vagina and cervix can ascend into the uterus and give rise to preterm labour. There are many more causes of preterm labour.
I suggest you get a hysterogram done after you start normal menses. The timing of this special x-ray should be just before your menses - so you must make sure you are not pregnant again, before the x-ray. For preventing a pregnancy, the best method is abstaining from sex in that cycle; it is also important you do not have sex and take antibiotics before and after the x-ray to prevent infection. This x-ray will give information regarding any congenital malformation in shape of the uterus and of the weak cervix (incompetent os). After all tests are done, you can attempt a pregnancy - preferably 6 months later.
However, even if no cause was found for the preterm labour this time, you must be under the strict supervision of an obstetrician - because there are slightly higher than normal chances of a repeat preterm labor. I am giving you this information so that you take adequate precautions as will be advised by your obstetrician when you are pregnant again.