And also so when they get cleared for “runway 15” they know which side to come on without having to consult a chart.
Also so there’s no confusion, each direction is named, so a runway that runs due North-South will be Runway 36 in the northern direction, and 18 to the south.
In practice it is rare for all but the largest airports to have more than 3 or 4 runways so it isn’t like there will be a Runway 2 and a Runway 3 at the same airport. If they need more capacity they’ll build parallel runways which will be named with a suffix, like 9L and 9R.
(Also, magnetic compasses aren’t that accurate in the first place, since there’s iron in the engines if nothing else. In theory there should be a compensation/calibration done with the results on a card, but, no guarantees that it’s done or up to date).