To start, grease a 9"x-13" baking dish with cooking spray or butter and set it aside.
In a heavy-bottomed Dutch oven, heat the olive oil over medium heat. Add the chopped onions and cook, stirring occasionally, until they become soft, which should take about 5 minutes.
Next, add the ground beef to the pot and cook, stirring occasionally, until it starts to brown, around 3 to 5 minutes.
Lower the heat to medium-low and add the minced garlic, stirring until it becomes fragrant, about 1 minute.
Incorporate the ground cinnamon, paprika, dried oregano, and bay leaf, stirring until they release their aroma, about 1 minute.
Add the diced tomatoes along with their juices, 1 teaspoon of salt, and sugar, stirring everything together.
Then, add the eggplant chunks and red wine, mixing well. Cover the pot partially and let it return to a simmer, cooking until the eggplant is tender and the excess liquid has evaporated, which should take about 30 minutes. Remove from heat.
While the sauce is simmering, bring a large pot of salted water to a boil and cook the ziti for half the time indicated on the package. Once done, drain the pasta.
Add the cooked ziti to the meat sauce, stirring to ensure the noodles are fully coated.
Position a rack in the top third of the oven and preheat it to 375ºF.
For the béchamel, warm the milk in a small saucepan over low heat.
In a medium saucepan over medium heat, melt the butter, then sprinkle in the flour and whisk until the mixture is smooth. Cook this for 2 to 3 minutes until it slightly darkens and smells nutty.
Gradually pour the warmed milk into the butter mixture while continuously whisking until it thickens to a custard-like consistency, which should take about 5 minutes. Remove from heat and stir in the Parmesan and nutmeg, seasoning with salt.
Allow the béchamel to cool slightly, then whisk in the egg yolks.
To assemble, transfer the pasta mixture to the prepared baking dish and spread it into an even layer.
Using a rubber spatula, evenly spread the béchamel over the pasta, making sure to reach the edges. Sprinkle the top with ¼ cup of Parmesan.
Grease the underside of a piece of foil with cooking spray and cover the dish loosely. Bake for 20 minutes.
After that, increase the oven temperature to 400ºF, remove the foil, and bake for an additional 15 to 20 minutes, or until the top is evenly browned.