Shouldn't the solder mask be extended so it is continuous without gaps in the final PCB layout?
It is. What this is flagging is the limit on how thin the "sliver" or strip of solder mask is between pads
You need to check with your PCB manufacturer to see how small a "solder mask sliver" they allow. You can then set you "Minimum Solder Mask Sliver" appropriately in your design rules. If the "sliver" is to small, chances are it will simply peel or flake off when soldering or even handling. The other option is to reduce your solder mask expansion (the purple area around the red pad) but again, depending on your pcb manufacturers tolerances, you run the risk of having some of the solder mask on the solder pad itself
As a general rule (and especially, judging from the picture), I feel reducing the solder mask expansion (equal to or close to manufacturer tolerance) is the
first thing he should do -- you don't want your solder mask expanded any further away from the copper than you can safely get away with, even in a design where ERC already passes. And of course, you should be setting the minimum solder mask sliver according to manufacturer tolerance as well; but this is less important in some sense because solder mask expansion has a direct impact on the gerber files and the PCB you end up with, whereas minimum solder mask sliver is just a ERC check thing.
If you still have the error after setting both rules, then your manufacturer can't handle a component with a pitch this fine (without resorting to funny hacks like a) just ignoring manfacturer limits or b) making your pads thinner, both nasty things to do).