Preheat the oven to 350°F (175°C). Coat a 9x13-inch baking dish with nonstick cooking spray.
Bring a large pot of salted water to a boil. Cook the pasta according to the package directions until al dente, then drain and set aside.
Heat a large skillet over medium-high heat. Add the ground beef and cook until no longer pink, breaking it apart with a wooden spoon. Ensure the meat reaches a safe internal temperature of 160°F (71°C). Drain any excess grease.
Stir the diced onion, minced garlic, Italian seasoning, salt, black pepper, and red pepper flakes into the beef. Cook for about 5 minutes until the onion softens.
Pour the crushed tomatoes into the skillet and stir to combine with the meat mixture. Remove the skillet from the heat.
In a large mixing bowl, combine the ricotta cheese, the beaten egg, and half of the shredded mozzarella cheese. Gently fold the cooked pasta into this cheese mixture until evenly coated.
Spread the pasta and cheese mixture evenly across the bottom of the prepared baking dish. Pour the meat and tomato sauce over the pasta layer, then sprinkle the remaining mozzarella cheese on top.
Bake uncovered for 30 minutes, or until the cheese is melted and the edges are bubbling. Let the casserole rest for 5 minutes before garnishing with chopped parsley and serving.