Combine spaghetti squash, vegetable broth, rosemary, and salt in a multi-functional pressure cooker (such as Instant Pot(R)). Close and lock the lid. Select high pressure according to manufacturer's instructions; set timer for 7 minutes. Allow 10 to 15 minutes for pressure to build.
Release pressure carefully using the quick-release method according to manufacturer's instructions, about 5 minutes. Unlock and remove lid. Remove spaghetti squash and cool until easily handled. Scrape insides of squash into spaghetti strands with a fork.
Heat olive oil in a skillet over medium heat; stir in onion and garlic. Cook and stir until the onion has softened and turned translucent, about 4 minutes. Add mushrooms; cook until tender, about 3 minutes. Pour in peeled tomatoes and season with salt, black pepper, sage, and bay leaves. Cook over medium-high heat and bring to a boil. Reduce heat to low and simmer, covered, about 20 minutes. Remove bay leaves and stir in basil. Serve over spaghetti squash.