Heat olive oil in a large pot over medium heat. Add the diced onion and garlic, sautéing until softened, about 3-4 minutes.
Add the ground beef or Italian sausage to the pot, breaking it up with a spoon. Cook until browned and no longer pink, about 5-7 minutes. Drain excess fat if necessary.
Stir in the diced tomatoes (with juice), beef broth, tomato paste, oregano, basil, and red pepper flakes (if using). Bring the mixture to a boil.
Once boiling, reduce the heat to low and stir in the gluten-free pasta. Simmer for about 10-12 minutes, or until the pasta is cooked al dente, stirring occasionally.
In a separate bowl, mix the ricotta cheese, half of the mozzarella, and the Parmesan cheese. Season with salt and pepper to taste.
To serve, ladle the soup into bowls and add a generous scoop of the ricotta mixture on top. Sprinkle with the remaining mozzarella cheese and garnish with fresh basil if desired.
Feel free to add vegetables such as spinach, zucchini, or bell peppers for extra nutrition.