Dice sweet potato into small ½-inch cubes, and set aside. Line a medium pot with a thin layer of water and saute onions and garlic for a minute. Add a pinch or two red pepper flakes and continue to cook until all the water has cooked off. Add turmeric, ¼ tsp garam masala and stir to coat. Add 1 cup broth, uncooked lentils, and bring to a boil. Once boiling reduce to low, cover, and simmer for a few minutes, about 5. Add sweet potatoes, bring to a boil again and reduce to low and simmer, until lentils are fully cooked (they expand and the sauce thickens), about 5 minutes more. Check periodically to see if you need additional broth (I tend to add an extra ½ cup but it can vary). Once lentils are cooked and sweet potatoes are fork tender, taste, adding more garam masala as desired (I like to add another ¼ tsp but some blends are stronger than others). Add spinach, continuing to stir until spinach cooks down and softens. Add salt to taste and serve.