Template:~/Doc

is a template that inserts a single space.

Sometimes when writing templates, it's difficult to get a space inserted by simply typing a space. The template parsing code, strips the space away. Use of this template, bypasses the parser and gives you a space regardless.

See for example Template:Task.