The space is removed when the variable is pasted or typed (whether using "Insert text by pasting" or "Insert text by typing").
Is this an expected behaviour?
My work around is to add another Insert text command just containing a space, but I would like to know if there is setting I am missing with the macro I attached.
@tiffle's is the proper solution -- but don't forget you can include literal text in your "Insert Text by Pasting..." action. So you can whatever you need to add after your variable token -- in this case you could append a space character.
Except you can't see it! Spaces, returns, and other "invisible" characters can be hard to spot in a text box, but you can use tokens to make their presence obvious: