No, there isn't anything wrong with it, if whitespaces are necessary for the user's input, don't trim away, but if they aren't I would suggest you to trim whitespaces.
For example, suppose someone enters a multi word string that you want to split apart.
Normally, you would break strings apart by splitting them using whitespaces as a delimiter, but if whitespaces aren't trimmed, you may or may not get an empty variable at the beginning. This will almost always have you guessing whether or not to use the first element of the split string. It really makes it a lot easier if you just trim whitespaces. Otherwise, you'll have a large block of code to figure out whether the first element of the split string is a valid entry or not.
" This string" would be split into an array that looks like this.
$string[0] = ''
$string[1] = 'This'
$string[2] = 'string'
but "This string" is simply
$string[0] = 'This'
$string[1] = 'string'
If you are doing string operations, you may want to find out how many words are in a string, the first case (above) would show you 3, while the latter would show you 2. There's just too many things to look for unless, the beginning or trailing whitespaces are really necessary.