Why would my pumpkin beer taste sour?

Unless I’m misunderstanding what you’ve written it sounds like you may have misunderstood the fermentation step and pitched (mixed in) the yeast In your wort and bottled it. Actually once cool, your wort should have gone into a fermenter with the yeast, been sealed up with an airlock and been placed in a cool dark place for a few weeks. Once the fermentation was complete then you would mix in some priming sugar and bottle it. Here’s a link to the process on Northern’s site:

How to Make Beer in 4 Basic Steps - Homebrewing 101 for Beginners