Elon Musk’s SpaceX raised $250 million from its first-ever high-yield loan sale, shrinking the size of the loan by $500 million after the company encountered a mixed reception from investors and worsening credit-market conditions.

The loan, facilitated by Bank of America Corp. and slated to fund general corporate purposes, opens a new avenue for fundraising for SpaceX as it looks to pay for massive projects demanding many billions of dollars over the next few years.

Based...