Millisecond pulsars and the Galactic Center gamma-ray excess: the importance of luminosity function and secondary emission