That is why Bernie Madoff, who caused billions in damages, got a very harsh sentence.
Source: I just asked my girlfriend, a third year law student. Also, you know, the judge for Shkreli's case: https://www.reuters.com/article/us-usa-crime-shkreli/pharma-...
"[U.S. District Judge] Matsumoto said in Monday’s order that under federal law, all of the money that investors put in Shkreli’s funds as a result of his fraud, about $6.4 million, must be considered loss. She also said he should get no credit for paying investors back because he only did so after they became suspicious. "
In Shkrelis case the judge dismissed this argument specifically because he only paid his investors back after they had already became suspicious, had he done so before that his behavior would have almost certainly been viewed differently.
It is absolutely normal to take things like this into account during sentencing.
And since it seems to be terribly difficult for some people here to understand, I'm not defending Shkreli and nor do I think there's anything wrong with his sentence.