if it were my fence ...and the fence had no rot & still had years of service ahead of it ...
I wouldn't replace the fence to "fix" the gaps and holes ....instead I would get a few cans of
expanding insulation foam
most expanding foam types are paint-able ....
and a few are waterproof (the difference: open cell foam = not waterproof -or- closed cell foam = waterproof) ....
with a helper on one side of the fence holding a board, piece of cardboard or even a plastic garbage bag - to control the expanding foams shape or texture
Once dry - can cut, saw or sand
the one drawback - it can get messy real fast ....