Wash salsify well and peel off the outer skin and coating. Cut into 2-inch pieces.
Heat oil in a large stockpot over medium. Add onion, beets and garlic to pot and cook, stirring frequently, until onions are tender, about 8 minutes.
Add rosemary, salt, black pepper and red pepper flakes. Stir in vegetable stock, tomato sauce and lentils. Bring to a boil, then reduce heat and simmer for 15 minutes; then add the salsify and continue to cook for another 10-15 minutes until lentils and salsify are tender. Stir in spinach and season with salt and pepper.
Divide between four bowls and top soup with shaved cheese, if desired.