SpaceX will not be part of the S&P 500 when it lists, so you can avoid owning SpaceX for now by sticking with non-NASDAQ funds. IIRC it would take about a year for SpaceX to qualify for the S&P 500, four consecutive profitable quarters is needed I believe.
If you own a NASDAQ fund or total US stock market fund, you will have exposure to SpaceX.