Adjust an oven rack to the center position and preheat the oven to 350°F. Apply a thin layer of nonstick baking spray to a 9-by-9-inch square baking pan. After that, spray once more and line the pan with parchment paper, leaving a small overhang on the sides. This guarantees that the parchment paper sticks firmly to the pan and serves as a precautionary measure to avoid any sticking. After that, leave it aside.
Mix the flour, baking soda, cardamom, cinnamon, and salt in a medium-sized bowl. After thoroughly mixing the dry ingredients, set them aside. Add the eggs, oil, sugar, milk, vanilla extract, and maple syrup to a large bowl. The wet components should be well mixed by whisking them carefully. Mix in the flour mixture just until it's well mixed. Just blend the cake batter by folding in the walnuts and grated zucchini. After that, transfer the cake mixture into the baking pan that has been ready, and use an offset spatula to level the top as needed.
A toothpick put into the center of the cake should come out clean after 30 minutes of baking. Give the cake fifteen minutes to cool in the pan. After that, transfer the cake to a wire rack to finish cooling. Allow cake to cool fully before icing.
For the cream cheese frosting, beat the butter and cream cheese for approximately two minutes, or until light and fluffy, in a medium bowl using a handheld electric mixer or in a stand mixer fitted with the paddle attachment. Next, add the salt and vanilla bean paste (or extract), and beat again until well blended. When the frosting is creamy and thoroughly blended, add the powdered sugar and beat again.
After the cake has cooled, cover it with the cream cheese frosting. If desired, top the cake with more chopped pecans or walnuts. Serve the spiced zucchini cake by slicing it into 9–12 wedges, or 16 wedges if you want a cute little snack cake. Have fun!