On modern rally and rallycross vehicles, it's very common to see an array vertical fins mounted on either the top or the bottom side of the main horizontal wing surface.

Some of those fins/walls look like they are there for structure support. But structural integrity is definitely not a problem without them assuming reasonable material and mounting. Track cars designed for much higher aero load typically don't use them, neither did older Group B/S cars with larger wings.

The fins also appear to be for some kind of aero effect, likely to guide/straighten the air flow, similar to the vertical strakes of a diffuser. But if that's the case, what makes rally/rallycross cars so special that such a design is justified on them, while on almost all track cars and the majority of high-class hillclimb cars it's not?

WEC LMP and F1 cars do use vertical stabilizers, which might be harder to do when dealing with the production-based bodywork of a rally/rallycross car.

I think it could be similiar to the plates seen on some aircraft wings:
Lift (or downforce) is only generated when the airflow stays attached to the surface. If it deattachs then the wing is "stalled" and no longer works.
Seperating the wing into multiple smaller areas prevents the whole wing stalling at once.

As Rally cars are quite often sideways, the vertical fins are there to redirect the air flow over the surface of the wing that actually provides the downforce.

While I do see how going sideways can make a difference, doesn't that apply to hillclimb as well, even more than production rally(cross) when wings are larger? The majority of purpose built hillclimb cars don't utilize this design. Those who do are mostly lower class vehicles with production-based body work.

Maybe a taller wing can enjoy cleaner air flow with less turbulence. But the sideways nature doesn't change.

The fins help keep the airflow perpendicular to the wing. In straightline there is small loss in downforce and increase in drag because you have little less wing area and more structures in the air. But in corners the fins improve the downforce loss (you lose less downforce). And because rally cars go more sideways that loss at smaller angles is less than what you gain at higher angles. Cars that go more straight go to the opposite direction. See the swan neck rear wing mounts for example.

Not a chance that they would add several grams of weight for style in top tier motorsports. Factory fitted on the the 06 Impreza it is most likely to only affect style, as well as aftermarket variants.

If I recall correctly they minimizes turbulence (at least puts a limit of the turbulence radius) it then helps the air go (as previous posters suggested) straight across the wing as intended. (code word: laminar flow)

If you compare the WRC to the racing or hillclimb wings you notice that the WRC wing is lower than the roof line, and the hillclimb cars having wing up above the roof line in less disturbed air.

Aerodynamics is a often unintuitive dark art where the black wizzards wants to keep their advantage by keeping the knowledge secret. There is very little accessible information for amateur motorsports teams and for racing fans. There is also a reason it is not accessible, there are no universal rules, as the rules can be spoiled by minor mistakes that destroys any chance of benefit for the aero.