Preheat the oven to 375 degrees F. Cut the squash in half lengthwise and remove the seeds and any visible strings. Place the two halves cut-side down on a baking sheet and bake until soft, about 45 minutes.
In the meantime, coat a 13-by-9-inch baking dish with cooking spray. Heat the oil in a large saucepan over medium heat. Add the onion and saute until translucent, 5 to 7 minutes. Add the garlic and cook until fragrant, 2 minutes. Add the kale and chicken and cook down, about 5 minutes. Sprinkle with salt and pepper, and turn off the heat.
In a large bowl, combine the ricotta, egg, 1 1/2 cups mozzarella cheese and the cooked kale mixture. Stir until well combined and sprinkle with salt and pepper.
Spread 1/2 cup of marinara sauce on the bottom of the prepared baking dish, then spread half of the cooked spaghetti squash on top. Top with half of the ricotta mixture followed by 1 cup of marinara sauce. Repeat the layers once more, ending with a layer of sauce; sprinkle the top with the remaining 1/2 cup of mozzarella cheese.
Bake until it is hot and the cheese is melted, bubbling and slightly browned around the edges, 25 to 30 minutes. Let stand for about 10 minutes, then top with basil, if using, and serve.