Optimal layer sequencing of a multilayered acoustical foam is solved to maximize its sound transmission loss. A foam consisting of air and poroelastic layers can be optimized when a limited amount of a poroelastic material is allowed. By formulating the sound transmission loss maximization problem as a one-dimensional topology optimization problem, optimal layer sequencing and thickness were systematically found for several single and ranges of frequencies. For optimization, the transmission losses of air and poroelastic layers were calculated by the transfer matrix derived from Biot’s theory. By interpolating five intrinsic parameters among several poroelastic material parameters, distinct air-poroelastic layer distributions were obtained; no filtering or postprocessing was necessary. The optimized foam layouts by the proposed method were shown to differ depending on the frequency bands of interest.