Preheat oven to 350°F.
In a medium bowl, stir together the flour, baking powder, baking soda, cinnamon, pumpkin pie spice, and salt.
In a large bowl, beat the pumpkin, granulated sugar, eggs, oil, and vanilla with an electric mixer on medium speed until well combined. Add the flour mixture and beat on low speed just until combined. Spread the batter evenly in an ungreased 15- × 10- × 1-inch rimmed baking pan.
Bake for 25 to 28 minutes, or until a toothpick inserted in the center comes out clean. Cool completely in the pan on a wire rack.
In a large bowl, beat the cream cheese and butter with an electric mixer until smooth. Add the vanilla, 3 cups powdered sugar, and 1 teaspoon lemon juice and beat until smooth and creamy. Gradually add as much of the remaining ½ cup powdered sugar as needed to reach a smooth, spreadable consistency. Add up to 1 teaspoon additional lemon juice, if desired, to balance the sweetness.
Spoon the frosting over the cooled bars and spread it evenly with an offset spatula. If desired, sprinkle with chopped walnuts or pecans and additional cinnamon. Cut into bars. Store, covered, in the refrigerator for up to 5 days.