Peel and cut the potatoes into chunks. Cook them in a large pot of boiling salted water until tender (about 15 minutes). Drain the potatoes and mash them with the butter and hot milk until smooth. Season with salt and pepper, to taste.
In a skillet, heat the olive oil over medium heat. Add the spinach and sauté until just wilted. Add the minced garlic towards the end of cooking and sauté briefly until fragrant. Season with salt and pepper, to taste.
In a baking dish, spread an even layer of mashed potatoes. If using spinach, spread it evenly over the mashed potatoes. Then arrange the chicken meatballs in tomato sauce directly on the spinach or mashed potatoes. Top with the mozzarella slices and sprinkle with grated Parmesan cheese if desired.
Bake the dish for about 25 to 30 minutes, until the mozzarella is melted and golden, and everything is heated through.
Remove the gratin from the oven and garnish with a few fresh basil leaves. Serve hot.