Lot of attention being given to the "elbow", think some people are missing the fact that Sagan started in the middle of the road and ended up right near the barrier - which he should have been aware of. There was room for Demare to get through, there should also have been room for Cav to get through. I don't think it was really intentional on Sagan's part, but it was certainly reckless.
As for the judgement, we're all just amateurs really so it's difficult to say. All of the camera angles we've seen tell very different stories, and I assume the commisaires have even more. As i see it there are a few reasons for disqualification. 1) To keep other riders safe, 2) to highlight the severity of the situation and make sure everyone's aware of how serious deviating in a sprint can be, 3) to manage certain riders egos and make sure they understand they're not above the law, and 4) to allow for a sprint and points competition in the race that's more in line with what the french organisers wanted anyway. Some naturally more justified than others, but it's an understandable decision.