Stack views are supposed to stretch like that !!!
You simply have your constraints wrong.
If you're already an autolayout expert, it is easy, just one click. But it's really impossible unless your storyboard is open in Xcode...
Some basic tips,
(1) try these two settings extensively:

You'll need to read every article on them, and all the source doco.
(2) make sure you are simply constraining the height of the stack view itself! If indeed, that is what you want. (There are many, many ways to do this and it depends on your layout. For example, it might be "some fixed height" or "80% of the height of some other element" .. or whatever, depends on you.)
(3) carefully review this article:
https://stackoverflow.com/a/40977494/294884
(4) Nobody has a clue what result you want, but if you do use a stack view, it's very likely you want to set the TOP of it, BUT NOT THE BOTTOM. In this way, the stack view will just become "whatever height is necessary" for the two elements in question. You could say the elements will set the overall height of the stack view, not the stack view. Sounds good?