The answer to this has to do with consumer tastes and perceived quality. Consumers tend to feel that a brand name product is of higher quality than a product that does not have a brand.
One of the determinants of the level of demand for a good is consumer tastes. If consumers believe that the good is of high quality, they will pay more for it than if they think it is of low quality. This is where branding comes in. Creating and publicizing a brand tends to create the perception of quality among consumers. When they perceive this, they will pay more for the good.
So, the reason for this is that consumers believe that branded goods are of higher quality and therefore are worth a higher price.