Aside from the D20 versions of Star Wars, which are different enough that they can't be used in combination with many normal D20 products like d20 Mecha, are there any books that have rules for creating and using spaceships in the D20 family?
Yes, the D20 Future line includes Open Game Content (OGC) starship rules.
You can get the official Starships SRD in charmingly-2000s Rich Text Format direct from Wizards of the Coast, or you can get them in convenient, futuristic HTML from a variety of online D20 Future SRD repositories, such as these: Starships at D20 Resources; Starships at DM Reference.
However, the combat rules included are considered fairly underwhelming (imagine normal D&D 3.5 combat, but you're in an endless empty room with no cover or other reasons to manoeuver and your choices are often limited to moving or shooting), and you might find fan-made replacements more interesting to use along with the rest of the OGL rules.
Besides d20 Future, there was also a d20 Traveller edition which had a bunch of first and third party support including extensive starship oriented products. Even large tracts of the main T20 Traveller's Handbook were devoted to starship design sequences.
The d20 Traveller game itself wasn't great, I'll be honest. Here's a full review I wrote for RPG.net. But the starship rules were more Traveller-inspired than the main system which was a pretty bad d20 adaptation.