Bring a large pot of salted water to a boil and cook the spaghetti according to package instructions until al dente. Drain and set aside.
In a mixing bowl, combine the ground beef, breadcrumbs, beaten egg, grated Parmesan, salt, and black pepper. Mix until just combined; do not overwork.
Form the meat mixture into evenly sized meatballs, about 1 to 1 1/2 inches in diameter.
Heat olive oil in a large skillet over medium heat. Add the meatballs in batches and cook, turning occasionally, until browned on all sides and cooked through, about 8–10 minutes depending on size. Transfer to a plate.
In the same skillet, add the minced garlic and cook briefly until fragrant, about 30 seconds. Pour in the marinara sauce and bring to a simmer.
Return the cooked meatballs to the sauce, cover, and simmer for 5–10 minutes so flavors meld and meatballs finish cooking.
Toss the drained spaghetti with some of the sauce, divide among plates, top with meatballs and additional sauce, and garnish with basil or parsley if using.