Although it is not illegal to share lanes with motorcycles, it is unsafe.
Cars and motorcycles each need a full lane to operate safely. Lane sharing is not safe. Riding between rows of stopped or moving cars in the same lane can leave you vulnerable. A car could turn suddenly or change lanes, a door could open, or a hand could come out of a window. Discourage lane sharing by others.
I got my motorcycle permit before I learned to drive a car. I recently gave it up, simply because it's too dangerous. I suppose if there's any part of your body you wouldn't mind losing, then you can get away with not protecting it. But I want to keep all of mine, which is why suiting up for a ride takes over 10 minutes.
That's why it baffles me that on top of the already dangerous activity of simply driving a motorcycle on the road, many riders feel the need to crank up the risk factor and speed along between lanes of traffic mere inches from impact. I don't care if it is legal. So is smoking. So is eating meat. So is riding without a helmet in one of the 30 states that don't require it. Just because something is legal, doesn't mean it is safe.
Nor does it mean you necessarily have the right to do it. Drivers are under no obligation to make room for motorcycles splitting lanes. In fact as the California Motorcycle Handbook states, drivers should "discourage lane sharing by others." I do just that, and I encourage other drivers to do the same.