Preheat the oven to 375°F (190°C).
Bring a large pot of salted water to a boil and cook the ziti pasta according to package instructions until al dente. Reserve 1 cup of pasta water before draining.
In a large skillet, cook the ground beef over medium-high heat until browned, breaking it into small pieces as it cooks.
Add the diced onion and minced garlic to the skillet and cook until the onion is translucent.
Stir in the crushed tomatoes, tomato sauce, dried basil, dried oregano, salt, and pepper. Bring the sauce to a simmer and let cook for 10-15 minutes, stirring occasionally.
In a large bowl, combine the cooked ziti pasta, the meat sauce, and the reserved pasta water. Mix well to combine.
In a separate bowl, combine the shredded mozzarella cheese, shredded ricotta cheese, and grated parmesan cheese.
Grease a 9x13-inch baking dish with cooking spray. Add the pasta mixture to the baking dish and top with the cheese mixture.
Cover the baking dish with aluminum foil and bake for 25 minutes.
Remove the foil and continue baking for an additional 10-15 minutes, or until the cheese is melted and bubbly.