The initial .* takes the regex all the way to the end of the string; then it backtracks just far enough to match the -D closest to the end. One solution is to change the substitution to:
$str =~ s/.*?(?=-D)//;
The non-greedy matching moves forward one character at a time, until -D matches. Because the -D is in a positive lookahead assertion, it's not used up as part of the match, so it doesn't need to be replaced on the right hand side.
Another approach is to match what you want and pull it out:
($args) = $str =~ /(-D.*)/;