For those curious about the actual rules:
See 2.3.036 on pg 37 here:
http://www.uci.ch/mm/Document/News/Rulesandregulation/18/23/94/2-ROA-20170701-E_English.PDF
"Riders shall be strictly forbidden to deviate from the lane they selected when launching into the sprint and, in so doing, endangering others."
and for punishments see pg 13 here:
http://www.uci.ch/mm/Document/News/Rulesandregulation/16/26/68/12-DIS-20170701-E_English.pdf
"10.1.Deviating from selected lane, endangering
other riders
10.1.2. Stage Race
1st offence: relegation to the last place in his group, point
classification penalty equal to the points awarded to the first
place of the stage, 200 + 30’’ in general class.
2nd offence: relegation to last place in the stage, point
classification penalty equal to the points awarded to the first
place of the stage, 200 + 1’ in general class.
3rd offence: elimination + 200"
Even if they had punished Sagan for his sprint on stage 3, stage 4 would be his second offense meriting only a relegation, 50 point penalty, a 1 minute time penalty that he couldn't care less about, and 200 swiss franc fine.