Does taking lsd have an association with developing a mental illness in the future?

No. But the effects of lsd on future "flashbacks" are poorly understood. The problem with "street drugs" are not necessarily the drugs themselves. I could talk about lsd in detail. But, because it is illegal, and you are buying it off the street, we have no way of knowing what you are actually taking. It could be lsd. Or, it could be something completely different.
Probably. One should not underestimate the effects of LSD. Use of LSD is not compatible with having a safe and responsible life. The potential for extreme anxiety and psychosis is extremely high. I doubt the are good longitudinal studies examining this issue but it's safe to say that LSD is a dangerous drug.
Maybe. If a person, especially has an underlying predisposition toward developing a major psychiatric condition such as schizophrenia or bipolar disorder, drugs like lsd can precipitate an episode, make an episode more severe or make it that much more difficult to recover. Lsd is a very powerful drug. While some have no adverse effects, others might. Lsd can increase one's risks.