Preheat the oven to 425 degrees F and lightly grease two large baking sheets.
Prep and cook the squash: Carefully halve the spaghetti squash lengthwise. Scoop the seeds and pulp from the center, then brush each halve with about 1 teaspoon of olive oil. Lightly season with kosher salt and black pepper, and place cut side down on the baking sheets. Bake for 35-45 minutes, or until the spaghetti squash are easily pierced with a knife. Set aside to cool until easy enough to handle.
Cook the beef: While the squash roasts, cook the beef. Heat a large skillet over medium heat until warm, then add the remaining oil. Once warm, add in the beef along with the red pepper flakes and black pepper. Cook for 5-8 minutes, or until cooked through, breaking the beef up with a spatula as it cooks. If needed, drain any excess fat from the skillet. Then, add the marinara and continue to cook until warmed through and set aside.
Layer the lasagna: Once the squash is cool enough to handle, scrape the spaghetti strands from the squash and place ¼ of the spaghetti strands in the bottom of a greased 9x13 baking dish. Dollop on several spoonfuls of ricotta (about ¼-⅓ cup) followed by ¼ or ⅓ cup of the marinara mixture. Repeat layering until all the ingredients are used up. Reduce the oven temperature to 375 degrees F.
Bake: Cover the baking dish with a sheet of foil and bake for 25 minutes. Uncover, and bake for a final 10 minutes.
Serve: Cool slightly, then serve while fresh with additional thinly sliced basil and red pepper flakes, or as desired.
Notes
If you are using dairy-free ricotta, I like to make it in 1-2 days in advance and refrigerate until ready to use. If you are making it at the same time as the lasagna, make it while the squash roasts.
If you're short on time, you can use my quick Instant Pot Spaghetti Squash recipe to cook the squash in 7 minutes.