Melt butter in a Dutch oven or medium pot over medium heat. Add shallot and cook 2-3 minutes until tender. Add garlic, red pepper flakes, and oregano to pot and saute 1 additional minute until fragrant. Deglaze pan with vodka, scraping up any browned bits.
Add tomato paste, whole tomatoes, and basil leaves to pot. Bring sauce to a simmer over medium-high heat, then reduce heat to medium-low, cover, and let simmer 20-30 minutes until slightly reduced, stirring and smashing tomatoes occasionally.
Discard basil leaves, transfer sauce to a blender or use an immersion blender and blend on high speed until sauce is smooth or to your desired level of chunkiness. Pour sauce back into pot and stir in sugar and cooked gnocchi until evenly coated. Season with salt and pepper to taste
Preheat oven to 400F and lightly grease a round or square 9-inch baking dish.
Spoon half of gnocchi mixture into prepared baking dish and top with half of ricotta, mozzarella, and Parmesan. Repeat layers one more time ending with Parmesan cheese.
Bake gnocchi at 400F 20-25 minutes until bubbly and cheese is golden brown. Optionally, broil gnocchi 2-3 minutes to brown and crisp up the cheese. Serve with crusty bread for dipping. Enjoy!