As Tumbler41 pointed out in the comments, the simpler solution would be to use E instead of W. However, if you would like to configure W to behave this way, you could do this:
nnoremap <expr> W getline('.')[col('.') - 1:] =~# '\s\S' ? 'W' : (col('.') + 1 == col('$') ? 'W' : '$')
Unfortunately, this solution is longer thank I'd like, and somewhat hacky, but it works. Here's a quick explanation of how it works:
"Use an 'expression mapping' on the key W. This means that we will evalue the
"mapping as vimscript code to determine what keystrokes to press
nnoremap <expr> W
"Get everything after the cursors position
getline('.')[col('.') - 1:]
"Does it contain a whitespace character followed by a non-whitespace character?
"If it does, return 'W'
"Are we on the last character?
(col('.') + 1 == col('$')
"If we are. return 'W'
"Otherwise, return '$'