Because phenolphthalein is an an indicator, and an indicator really is a weak organic acid/base with different colors for its conjugate acid and base forms.
It happens that phenolphthalein has the equilibrium HIn + H2O ⇄ In⁻ + H3O⁺ where the color of HIn is colorless and the color of In⁻ is pink.
In basic solutions, the OH⁻ from the bases will combine with the H3O⁺ to form H2O. This leads to decrease in [H3O⁺] so Le Chatelier's principle says that equilibrium will shift to the right to compensate. This makes the overall solution turn pink.