Novak Djokovic behaved poorly, in my opinion, against Sandgren. It looked like he thought he could beat him any time without putting out his maximal effort. At 70% effort he got sloppy in mid-match, and allowed Sandgren to squeak out the third set. And in the process, he was angry with himself for his lack of motivation, but couldn't seem to get out of it.
Basically, Novak Djokovic was disrespectful to Sandgren. As a competitor you owe it to your opponent to bear down, concentrate hard, and put out a maximal effort to beat him or her as decisively as you can. Anything short of that is disrespectful, and, in some cases, dangerous. (Your opponent will usually play as well as you let him or her, and if you take your foot off the gas, you are liable to create a monster that you can't stop.)
I felt bad for Sandgren. He was trying his guts out but just didn't have enough tennis tools to overcome Novak Djokovic, even though Djokovic had not really decided he wanted to play. That must have been frustrating for Tennys, and had he not prevailed in the third set it could have been downright embarrassing. Overall, it was an ugly performance by Novak Djokovic.