If you want to write text in math-mode then use \text{...}
or variants thereof for example:
$\text{This is some text with default font.}$
$\textrm{This is some text with specified font, which happens to coincide with the default.}$
$\textsf{This is some text in another font.}$
$\textbf{This is some text in bold.}$
$\text{This is some text with default font.}$
$\textrm{This is some text with specified font, which happens to coincide with the default.}$
$\textsf{This is some text in another font.}$
$\textbf{This is some text in bold.}$
The command \mathrm{...}
is not for "text" but for letters in a particular font (namely roman) in math mode. Thus, as usual in math mode, space is ignored; if you want some you can specify it explicitly.
$\mathrm{Text \ with \ space.\; Good.}$
$\mathrm{Text \ with \ space.\; Good.}$
Needless to say, this is not the way to include some phrase in a mathematical part.
There are similar commands for other fonts such as:
$\mathsf{Sans}$
$\mathbf{Bold}$
$\mathit{Italic}$
$\mathsf{Sans}$
$\mathbf{Bold}$
$\mathit{Italic}$
\mathrm
is not for text, it's for setting mathematical stuff in roman font. $\endgroup$\text
for text. $\endgroup$