The transverse momentum $({p}_{\mathrm{T}})$ distributions of $\mathrm{\ensuremath{\Lambda}}$, ${\mathrm{\ensuremath{\Xi}}}^{\ensuremath{-}}$, and ${\mathrm{\ensuremath{\Omega}}}^{\ensuremath{-}}$ baryons, their antiparticles, and ${K}_{S}^{0}$ mesons are measured in proton-proton $(pp)$ and proton-lead $(p\mathrm{Pb})$ collisions at a nucleon-nucleon center-of-mass energy of 5.02 TeV over a broad rapidity range. The data, corresponding to integrated luminosities of 40.2 ${\mathrm{nb}}^{\ensuremath{-}1}$ and 15.6 ${\ensuremath{\mu}\mathrm{b}}^{\ensuremath{-}1}$ for $pp$ and $p\mathrm{Pb}$ collisions, respectively, were collected by the CMS experiment. The nuclear modification factor ${R}_{p\text{Pb}}$, which is defined as the ratio of the particle yield in $p\mathrm{Pb}$ collisions and a scaled $pp$ reference, is measured for each particle. A strong dependence on particle species is observed in the ${p}_{\mathrm{T}}$ range from 2 to 7 GeV, where ${R}_{p\text{Pb}}$ for ${K}_{S}^{0}$ is consistent with unity, while an enhancement ordered by strangeness content and/or particle mass is observed for the three baryons. In $p\mathrm{Pb}$ collisions, the strange hadron production is asymmetric about the nucleon-nucleon center-of-mass rapidity. Enhancements, which depend on the particle type, are observed in the direction of the Pb beam. The results are compared with predictions from epos lhc, which includes parametrized radial flow. The model is in qualitative agreement with the ${R}_{p\text{Pb}}$ data, but fails to describe the dependence on particle species in the yield asymmetries measured away from midrapidity in $p\mathrm{Pb}$ collisions.