Because pajamas in summer must be refreshing, so you won't feel hot when you look at them. Wearing black or dark clothes in summer will be very hot, and black clothes will absorb heat and light.
However, if you like black very much, you can wear black, as long as your pajamas are comfortable to sleep.