Ever since Newton split white light and saw seven color bands that he identified with musical notes, people have attached mystical significance to the spectrum, even suggesting that the non-spectral hues are "unreal" just because they can't be produced by monochromatic light.
For the purposes of this question, I think the spectrum is irrelevant.
The whole neurological part of our visual system has nothing to work with but the firing rates of the cones. It doesn't know anything about frequencies of light; it doesn't know, for example, that the cone types have a linear order by peak frequency (L-M-S). It just has the firing rates of the three cone types, which you can think of as coordinates in a 3-dimensional space.
The visual system transforms to a different coordinate system for that space, whose axes are light-dark, red-green, and blue-yellow. This transformation is complicated: it's nonlinear, and depends on a dynamically adjusted white point. I think that the reasons why we use these particular primaries are largely unknown. It's widely claimed that the red-green axis is for recognizing fruit. Primary blue seems to perfectly match the color of the sky, but it's not clear why that would be advantageous. (Why is the sky blue? We don't know.)
If you ignore light-dark and just plot red-green versus blue-yellow, you get a color wheel, with grey in the center, the four primary hues in four directions outward from grey, and intermediate hues in intermediate directions.
If you draw the perceived colors of monochromatic light on this wheel, you get a meandering curve that crosses a large part of the wheel, but doesn't close on itself (since there's no reason why it would) and therefore misses some hues. The endpoints of the curve aren't at primary colors: one end is between red and yellow, the other between red and blue. That's because the ends don't matter. If it were useful to recognize the highest and lowest visible wavelengths of light, then they would be at primary colors, but it isn't, so the primary colors are assigned to more important things. The rest of the curve doesn't matter either (to the visual system). Monochromatic light doesn't occur in nature, for the most part, and there isn't any adaptive value in recognizing it. The color bands in a rainbow are a meaningless side effect of a visual system that evolved for other purposes.
So the reason that red and blue can combine to make violet is that violet is between red and blue on the wheel, and the reason that violet is also the hue of the shortest wavelength of visible light is that the meaningless short-wavelength end of the spectrum happens to fall there. There's no deeper reason.
I think some of the confusion is due to people believing that the color wheel is related to LMS cone firing rates in a simple way. For example, many people believe that the cone responses are RGB, or that the red-green axis is L−M and the yellow-blue axis is (L+M)−S. If that were true, then the L cone would have to have a second peak in the violet to explain why violet has red in it. But it isn't true, and there is no second peak. (If you see a second peak, you may be looking at in-vitro measurements that don't include the absorption of low wavelengths by the lens, or you may be looking at a mislabeled graph of the XYZ color matching functions.)