This paper investigates the massive access for a satellite-aerial-terrestrial network (SATN), where a high-altitude platform (HAP) is deployed as a relay to assist the uplink transmission from terrestrial user equipment (UE) to satellite. Unlike previous works, we adopt radio frequency (RF) and free space optical for the aerial-terrestrial and satellite-aerial links, respectively. Specifically, by assuming that imperfect angular information (IAI) of each UE is known at the HAP, we develop a space division multiple access (SDMA) scheme to maximize the ergodic sum rate (ESR). To this end, we first exploit the IAI to calculate the analytical expression of channel correlation matrix. Then, by considering the limitation of array freedom, we propose a subspace-based UE grouping and scheduling scheme to cluster all UEs into groups. Next, we present a computationally effective beamforming (BF) scheme for each UE at HAP to efficiently implement SDMA in the RF link. Furthermore, a closed-form expression for the ESR of the SATN is derived to validate the proposed BF and SDMA schemes. Finally, simulation results corroborate the derived theoretical formulas and reveal the impacts of array size, angular estimation error, the number of UEs and scheduling threshold on the system performance.