Bring a large pot of water to a rolling boil. Add 1 teaspoon salt and the lentil pasta. Cook according to package directions until al dente (usually 7–9 minutes). Stir occasionally to prevent sticking. Before draining, reserve 1/2 cup of the starchy pasta water, then drain the rest and rinse briefly under cold water to stop cooking. Return pasta to the pot.
While the pasta cooks, combine the soaked and drained cashews, almond milk, nutritional yeast, lemon juice, 1 clove minced garlic, salt, and black pepper in a high-speed blender. Blend on high until completely smooth and velvety, about 45–60 seconds. Set aside.
Place a large skillet over medium heat and add the olive oil. Once shimmering, add the sliced garlic and sun-dried tomatoes. Sauté for 1 minute until fragrant. Add the spinach in handfuls, tossing with tongs, until fully wilted (2–3 minutes). Stir in red pepper flakes if using.
Pour the blended cashew cream into the skillet with the spinach mixture. Stir and heat gently for 2 minutes until warmed through. If the sauce is too thick, whisk in reserved pasta water 2 tablespoons at a time until desired consistency. Add the cooked lentil pasta to the skillet and toss to coat every piece in the sauce.
Divide the pasta among bowls. Drizzle with a little extra olive oil, scatter torn basil and pine nuts (if using) on top, and add an extra pinch of red pepper flakes if you like heat. Serve immediately.