I am sorry to hear about your pregnancy loss. It could happen due to problems in the baby, placenta or a number of other reasons. In the absence of blood tests on you, and examination of the baby after it was delivered, it is not possible to determine the reason for the late miscarriage. Sometimes, even after doing all tests, we are unable to find a reason.
Because it has happened once, it does not necessarily mean that it will happen again in the future, if you conceive. Usually, but not always, miscarriages happen as an isolated episode, without recurrence in future.
Wish you all the best for the future.