When you mash, you are including base malts that have the enzymes necessary to convert starches in the base malt, specialty grains, and (in your case) your pumpkin. Instead of steeping your grains to get flavor out, like you would tea, you are actually letting the enzymes create wort. If you use enough grain, you can use less extract and save money as well.
When you make a pumpkin ale, you want to put the pumpkin in with your base malt and specialty grains and convert the starches in it to sugar. You won't get as much out of it if you're just soaking it in hot water with your steeping grains.