Direct numerical simulations (DNSs) of spatially developing turbulent boundary layers (TBLs) over two-dimensional (2D) rod-roughened walls and three-dimensional (3D) cube-roughened walls were performed to investigate the effects of the streamwise spacing of roughness elements on the properties of the TBLs. The inspection of the Reynolds stresses showed that except for the 2D rough walls with p(x)/k = 2 and 3, the effects of the roughness on the 2D and 3D rough walls extend to the outer layer and that the magnitude of the Reynolds stresses in the outer layer increases in proportional to p(x)/k. However, such results do not account for the variations with p(x)/k in the form drag and roughness function, which have maximum values at p(x)/k = 8 and 4 for the 2D and 3D rough walls, respectively. Finally, we examined turbulent structure through instantaneous analysis, linear stochastic estimation, and dynamic mode decomposition to the time-evolving flow fields to scrutinize the spatial organization of the outer-layer structures over several different rough walls.