But likewise, you are allowed to drive the line if it's yours. You don't have to bail out and let someone pass because they try to force their car in where it won't fit. You could argue that as Rosberg was behind and on the outside, he can't just drive into the side of Hamilton who's ahead, inside the corner and with the racing line.
When Hamilton got up the inside of Rosberg in turn 1 (which only happened because of Rosberg's worse start), and held it around the bend, Rosberg had no chance to get that back around the outside of turn 2. At that point Rosberg could have slotted in behind Hamilton and taken him with DRS a couple of laps later. By forcing the issue when he was in a vulnerable position, Rosberg had to spend the race getting from fourth to second. A little thought at the second corner and he could have spent the race chasing down Hamilton instead.
Hamilton basically put Rosberg into a vulnerable place, and Rosberg dealt with that badly, giving Hamilton exactly what he wanted.