  This letter reports the first measurement of spin alignment, with respect to
the helicity axis, for ${\rm D^{*+}}$ vector mesons and their charge conjugates
from charm-quark hadronisation (prompt) and from beauty-meson decays
(non-prompt) in hadron collisions. The measurements were performed at
midrapidity ($|y|<0.8$) as a function of transverse momentum ($p_{\rm T}$) in
proton-proton (pp) collisions collected by ALICE at the centre-of-mass energy
$\sqrt{s} = 13$ TeV. The diagonal spin density matrix element $\rho_{00}$ of
${\rm D^{*+}}$ mesons was measured from the angular distribution of the ${\rm
D^{*+}} \to {\rm D}^0 (\to {\rm K}^{-}\pi^{+}) \pi^+$ decay products, in the
${\rm D^{*+}}$ rest frame, with respect to the ${\rm D^{*+}}$ momentum
direction in the pp centre of mass frame. The $\rho_{00}$ value for prompt
${\rm D^{*+}}$ mesons is consistent with $1/3$, which implies no spin
alignment. However, for non-prompt ${\rm D^{*+}}$ mesons an evidence of
$\rho_{00}$ larger than $1/3$ is found. The measured value of the spin density
element is $\rho_{00}=0.455\pm0.022(\text{stat.})\pm0.035(\text{syst.})$ in the
$5 < p_{\rm T} < 20$ GeV/$c$ interval, which is consistent with a PYTHIA 8
Monte Carlo simulation coupled with the EVTGEN package, which implements the
helicity conservation in the decay of ${\rm D^{*+}}$ meson from beauty mesons.
In non-central heavy-ion collisions, the spin of the ${\rm D^{*+}}$ mesons may
be globally aligned with the direction of the initial angular momentum and
magnetic field. Based on the results for pp collisions reported in this letter
it is shown that alignment of non-prompt ${\rm D^{*+}}$ mesons due to the
helicity conservation coupled to the collective anisotropic expansion may mimic
the signal of global spin alignment in heavy-ion collisions.
