It’s because you’re using Horizontal orientation on the StackPanel. That means that the StackPanel is giving full width to each child control, and then laying them out horizontally – even if that means exceeding its bounded/visible width. Because there’s nothing to constrain the width of the TextBlock, it doesn’t wrap.
If you switch to Vertical orientation then the wrapping works, but I’m guessing there’s a reason for you specifying otherwise. Can you show what layout you’re trying to achieve?