Heat a large, high-sided skillet over medium-high heat and brown the ground beef, breaking it into pieces as it cooks; drain excess fat and optionally rinse with hot water, then wipe the skillet clean and return it to the heat.
Add the olive oil to the skillet, then sauté the diced onion, minced garlic, and diced carrot until softened, about 5–7 minutes.
Return the browned beef to the skillet and add the tomato sauce and/or diced tomatoes, tomato paste, cold water, basil, oregano, brown or granulated sugar, and bay leaves; stir to combine.
Reduce the heat to medium-low, cover, and simmer the sauce, stirring occasionally, for 1–4 hours until flavors meld; if it becomes too thick, add more water as needed.
When ready to serve, bring a large pot of water to a boil, salt the water, and cook the gluten-free spaghetti according to package directions; drain the pasta.
Toss the drained spaghetti with the meat sauce, season with salt and pepper to taste, and serve with grated Parmesan if desired.