Preheat the oven to 400°F and line a baking sheet with parchment paper.
Carefully slice the spaghetti squash in half lengthwise and discard the seeds. Place the halves on the baking sheet and season with black pepper to taste. Turn the squash flesh-side down and bake for 40 minutes.
Meanwhile, combine the crushed tomatoes, lentils, garlic, additional black pepper, and dried basil in a pot over medium heat. Bring to a simmer. Once simmering, add the spinach and stir just until wilted. Turn off the heat.
Remove the spaghetti squash from the oven and let cool slightly. Using a fork, scrape the flesh into noodle-like strands. Transfer to a strainer to allow excess liquid to drain.
Divide the spaghetti squash between plates or containers and spoon the vegetable tomato sauce over the top. Serve immediately, or let cool completely before covering and storing in the refrigerator.