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.
Best Answer
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.
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.
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).
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.