Human capital and productive structure could account for an important part of the differences in productivity between Spanish regions; nevertheless we consider that gender wage discrimination could also have effects on it. The existence of a degree of discrimination means that there is a wage differential in which employer prefer to hire less productive workers instead of discriminated workers. Thus, the cost of producing a unit of product would be higher than the cost of producing without discrimination, i.e. discrimination could has effects on productivity. Based on Becker (1957) we develop a maximization problem with discrimination using an aggregate production function with constant elasticity of substitution (CES). As a result, we get a productivity function depending on discrimination and other traditional factors such as wages or production. Our results show that the discrimination growth hast a negative and significant effect on productivity for the Spanish regions.