In a statement SpaceX provided to the media, it announce that it's taking steps to become a leaner company, since costly endeavors similar to those two had bankrupted other organizations in the past:
"To continue delivering for our customers and to succeed in developing interplanetary spacecraft and a global space-based Internet, SpaceX must become a leaner company. Either of these developments, even when attempted separately, have bankrupted other organizations. This means we must part ways with some talented and hardworking members of our team. We are grateful for everything they have accomplished and their commitment to SpaceX's mission. This action is taken only due to the extraordinarily difficult challenges ahead and would not otherwise be necessary."
According to Ars, one industry source suggested that this might also be a way for SpaceX chief Elon Musk to let some of the company's lower performing employees go. In addition, a Seeking Alpha report from late 2018 suggested that SpaceX might not be as profitable as it looked, despite Falcon 9 being a hit with clients to the point that rivals had to lower their asking prices to be able to compete. Whatever the company's motivations are, the layoffs could provide the extra funds it needs in the next few years, seeing as it will take a while before Starship and Starlink can start making money.