Just to save money using a standard port? Or are there technical reasons for choosing a port (DB25, DB23) knowing that many pins will go unused?
A little from column A, a little from column B.
Just like USB or similar ports today, even back in the early days of computing there were connectors that were basically standard across the industry. This did drive down costs and it also let people swap cables between different computers for a lot of things (the video output port on the Atari 8 bit line, C64, and TI 99/4A is standard 5 pin DIN and if you're connecting composite, you can use the same cable). But different computers might use more or fewer pins depending on the features they would support over that port. For example, some computers would output both composite and S-video over their video output port, while others would only output composite. So there's an extra unused pin.
I think some ports were also chosen in case of future upgrades, so they wouldn't need to replace the port later and potentially make for all sorts of incompatibilities. But I can't think of a specific example of that, it's one of those things I just remember reading somewhere, sometime and it's now in my head. It makes sense to me, though.