Heat a 12-inch deep sauté pan or Dutch oven on medium-high heat. Add the olive oil. Once shimmering, add the onions with a pinch of salt. Cook, stirring occasionally, until a light brown fond forms on the pan, about 5 minutes. Add a few spoons of water to deglaze, then continue cooking until the onions are softened and golden brown, 9 to 10 minutes total.
Add the garlic, thyme, oregano, kosher salt, and black pepper. Stir frequently and cook for 60 to 90 seconds.
Stir in the tomato paste and cook for 2 to 3 minutes, stirring very frequently, until it darkens to a deeper red.
If using red wine, pour it in and deglaze, scraping up any browned bits. Cook for 1 to 2 minutes until the alcohol smell burns off and the mixture looks jammy.
Pour in the vegetable broth, stirring to combine. Add the soaked moong dal and walnuts. Bring to a boil, then reduce to medium-low and simmer rapidly for 20 minutes, stirring occasionally.
Stir in the crushed tomatoes. Continue simmering for 15 to 20 minutes until the dal is tender but still al dente and the sauce is thick. Stir occasionally to prevent sticking; add a splash of water if needed.