1. For the onion mixture: Heat oil in oven over medium-high heat until shimmering. Cook onions until golden, 10 to 15 minutes. Add garlic, oregano, and pepper flakes and cook until fragrant, about 30 seconds. Transfer half of onion mixture to large bowl and set aside.
2. For the marinara: Add tomato paste to remaining onion mixture in pot and cook until fragrant, about 1 minute. Add wine and cook until slightly thickened, about 2 minutes. Stir in water and tomatoes and simmer over low heat until sauce is no longer watery, 45 to 60 minutes. Stir in cheese and basil and adjust seasonings with salt and sugar.
3. For the meatballs: Meanwhile, adjust oven rack to upper-middle position and heat oven to 475 degrees. Mash bread and milk in bowl with reserved onion mixture until smooth. Add remaining ingredients, except ground beef, to bowl and mash to combine. Add beef and knead with hands until well combined. Form mixture into 2 1/2-inch meatballs (you should have about 16 meatballs), place on rimmed baking sheet, and bake until well browned, about 20 minutes.
4. Transfer meatballs to pot with sauce. Simmer for 15 minutes. Serve over pasta. (Meatballs and marinara can be frozen for up to 1 month.).