Preheat the oven to 350°F and line two cupcake pans with 24 liners.
In a medium bowl, whisk together the flour, cinnamon, nutmeg, ginger, allspice, baking powder, baking soda, and salt. Set aside.
In a large mixing bowl, cream together the butter, granulated sugar, and light brown sugar with an electric mixer on high speed until fluffy, about 3-4 minutes.
Add in the eggs and vanilla, and mix on medium-high speed until smooth, pale, and slightly fluffy, about 2-3 minutes. Scrape the sides of the bowl as needed.
Alternate adding the flour mixture and buttermilk to the butter mixture, a little at a time, mixing on low then medium speed until just combined and smooth.
Fold in the grated carrots on low speed until evenly distributed.
Divide the batter evenly among the cupcake liners, filling each about three-quarters full.
Bake for 19-22 minutes, or until a toothpick comes out clean from the centers. Let the cupcakes cool in the pans for 10 minutes, then transfer them to a wire rack to cool completely.