This paper proposes an extended M-sequence/extended perfect difference (EMS/EPD) code family which can be applied to a two-dimensional (2-D) spectral/spatial (SS) fiber-optic code division multiple access (FO-CDMA) passive optical network (PON) with interference elimination. In addition, the proposed code family can effectively suppress the effect of phase-induced intensity noise (PIIN) and has a flexible size and the cyclic property. By using an extending technique, the number of fibers is substantially reduced between the remote node (RN) and the optical network units (ONUs). Furthermore, we design a compact optical line terminal (OLT) using the arrayed waveguide grating (AWG) router at the central office (CO) and simple ONUs using the thin-film filters (TFFs) at end users. Based on the mathematical analysis and numerical results, the 2D SS EMS/EPD code family is suitable for high-rate transmission with very good performance.