Well (poor driving here aside) the law doesn't. It's just as legal for a car or even a truck to lane split as a motorcycle. As in there simply isn't a law against it. (At least here in Europe.)
This is the problem with people bleating "it's legal" to justify the practice.
When it's dangerous, it's dangerous, whether or not there's an explicit law forbidding it.
We have the same situation in CA. There is no law specifying when it is legal or illegal to lane split, only guidelines from the CA Highway Patrol.
Here is the
proposed change to the vehicle code. It was passed by the CA assembly this year but has not made it into law. It addresses all your concerns (as well as mine). Even so, you actually have to tell people that it is
unsafe to pass
between two other vehicles unless you have both wheels on the ground??
21658.1.
(a) A
motorcycle, as defined in Section 400, that has
two wheels in contact with the ground may be driven between rows of stopped or moving vehicles in the same lane, including both divided and undivided streets, roads, or highways, if
both of the following conditions are present:
(1) The motorcycle is not driven at a speed of more than 50 miles per hour.
(2) The motorcycle is not driven more than 15 miles per hour faster than the speed of traffic moving in the same direction.
(b) This section does not authorize a motorcycle to be driven in contravention of other laws relating to the
safe operation of a vehicle.