Safe cycling isn’t always a matter of sticking to the side of the road. In fact, when bicyclists try to stay out of cars’ way, they can sometimes create a situation that’s more dangerous for themselves, cars, and pedestrians.
If you’re not used to sharing the road, seeing a cyclist in 'your' lane may seem a bit weird, or even rude. But cycling in a main road lane can be the safer option when:
The bike lane or shoulder is full of gravel, broken glass, or other hazards
The bike lane or shoulder disappears suddenly, or has parked cars or other obstacles in it
The bike lane or shoulder runs alongside a bunch of parked cars, which may open their doors suddenly
There is no bike lane or shoulder, actually
The cyclist is about to turn
There is not enough room for you to safely pass
It’s this last one that often annoys drivers, because it means you have to slow down and stay behind the cyclist. But if there’s not enough room to pass the cyclist safely, the cyclist is looking out for themselves and you by forcing you to sit tight for a moment.
Take the situation in the lead image, for example. If the cyclist were on the left side of the road, a car might cross the road’s dividing line trying to give him a wide berth. That’s dangerous here, because you can’t see if another car is coming around the curve.
The car’s other option, if the cyclist were on the left, would be to try to pass him while keeping the car in the left lane. That isn’t enough room to make the situation safe for the cyclist. So he’s riding in the right side of the lane to make both situations impossible. You can both wait until you get to an area with better visibility.
And yes, this is legal - and even safer. As a driver, I find slowing down behind a cyclist slightly annoying. But when I’m on a bike, it can be literally a matter of life and death.