Combine the cherry tomatoes, scallions, garlic, basil, oil, salt, and pepper in a food processor. Pulse the tomatoes until they are coarsely chopped, being careful not to puree them. Transfer the sauce to a bowl.
Preheat the oven to 350°F. Spray a 10 x 4 1/2-inch loaf pan with vegetable oil cooking spray.
Meanwhile, heat a large skillet over medium heat. Add 1 tablespoon of the olive oil. Add the carrot, onion, and celery and cook until tender, about 5 minutes. Transfer to a large bowl to cool slightly. Reserve the skillet.
In the same large skillet, cook the spinach over medium heat until the spinach wilts, about 3 minutes. Drain and let cool slightly. Squeeze the excess liquid from the spinach. Transfer the spinach to a cutting board and coarsely chop. Add to the onion mixture.
Add the lentils, brown rice, ¾ cup of the mozzarella, the corn, basil, beaten eggs, salt, pepper, and 3/4 cup of the sauce to the cooled onion mixture. Spoon the mixture into the prepared pan. Arrange the sliced tomatoes in 2 rows over the lentil mixture, covering the top completely. Sprinkle with the remaining ¼ cup mozzarella and drizzle with the remaining 1 tablespoon olive oil.
Bake until the loaf is heated through and the topping is melted and starting to brown, 30 to 35 minutes. Let cool for 15 minutes. Slice the loaf (still in the pan) into 1-inch slices, arrange on plates, and serve with the remaining sauce.