It's most recommendable to avoid padding varchar on the left to a certain length. Because it's an inefficient use of SQL.
According to me, you need the padding because you are dealing with a fixed length. Have a look at the given query.
right('XXXXXXXXXXXX'+ rtrim(@str), @n)
Here, X is the padding character and @n is the number of characters in the resulting string.