It sounds like this is correct behaviour. See Alignment: the 'text-align' property and Inline formatting contexts:
In the case of 'justify', this property specifies that the inline-level boxes are to be made flush with both sides of the line box if possible, by expanding or contracting the contents of inline boxes, else aligned as for the initial value.
If [the text-align] property has the value 'justify', the user agent may stretch spaces and words in inline boxes (but not inline-table and inline-block boxes) as well.
No white space, no justify.
The browser could use letter spacing to justify the single word in the second example. This would still result in a different displayed text for both cases though.
The problem is with the framework you are using, because it removes whitespace too eagerly. To solve this you should find a way to keep the whitespace. You could try using the unicode html entity of the space character: