How did "issue" come to mean "problem"?
The etymology of the word "issue" seems to be :
Middle English (in the sense ‘outflowing’): from Old French, based on Latin exitus, past participle of exire ‘go out’.
The many usages of "issue" are in keeping with this root. Supplying or distributing, magazine and similar periodicals, outcome of an action, children (archaic?), etc. But I really don't understand how it came to mean a problem.
The OED (paywall) notes (besides the definitions relating to "flowing from") a couple of definitions--matters to be decided or matters in contention (matters to be decided by debate or discussion).
And then:
16. orig. U.S. Chiefly in pl., and often with modifying word.
a. orig. Psychol. A emotional or psychological difficulty or problem; a point of emotional conflict.See also to have an issue with at Phrases 2g. 1977 J. S. Horewitz Family Therapy & Transactional Anal. 268 I think that my own personality and my issues do affect... how I am as a therapist.
The 1977 is the first quotation under this definition; there are several others.
About the same time, there's this definition:
b. A problem or difficulty with a service or facility; a failing in any system, esp. regarded as a matter to be resolved.
1978 SIAM Jrnl. Appl. Math. 35 233 Immediate dispatch is appropriate to minimize average wait for all..passengers [on the shuttle]. There are some technical issues..but they cause no trouble.
The cross-reference to "to have issues with" is listed as U.S. in origin and colloquial:
g. colloq. (orig. U.S.). to have an issue with: to have an objection to; to be unable to accept (a particular condition or circumstance).
1978 Proc. United Glass & Ceramic Workers N. Amer. 101/1 Mr Chairman, I am going to search my notes. If that is the way it is, I don't have an issue with that.
To summarize, the OED begins picking up this use of "issue" as a problem in the late 1970s. The legal definition, mentioned in the comment by @StoneyB, appears in the OED definitions with citations going back to the 15th century and seems to me to be related to later use of the term as a matter to be debated or decided, and is related to its use in terms such as racial issue, social issue, and the like.
I'm not sure I can help with the "how", but might be able to shed some light on "when": a Google Ngrams search of "has issues" and "has problems" shows that "issues" started being used in the 1970s, as people have said, but really started replacing "problems" in the 1990s.
My personal hypothesis, unfettered by such hindrances as evidence or data, is that psychiatrists in the 1960s and 70s preferred to say "let's talk about some issues" rather than "let's talk about your problems", and this euphemism gradually became adopted by the population at large.