Selling weapons generally don't pay much, so I tend to keep anything I find early on. Later on as I'm solidifying some kind of doctrine for my ships I tend to sell the stockpile of things I don't use, but by then it's not even about the money, but limiting the time looking over the weapons list when fitting new ships.
I've found it's nearly always a good idea to keep weapons you salvage or otherwise find for 'free' as they can make good options when you are desperate. Ironically my piracy runs always tend to be the poorest so the one fleet most likely to use a random smattering of different weapons and ships ends up being one of the few cases where I sell weapons, desperate for the money to keep my broke raider fleet running
Same policy goes for ships too btw. I hoard what I can, even if I don't use them right off the bat, because salvaging ships for your own use tend to be the only way to go, selling hulls you find often nets you far less than you paid in fuel and supplies to get that battered hull to the market. If it's a ship you have little to no interest in, scrapping it for salvage in the field is usually the best idea.