Money is pouring out of a popular investment tied to the oil market, a sign that a monthlong crude-price rally may be running out of gas.

Exchange-traded funds that invest in U.S. oil futures, including the $3.1 billion United States Oil Fund LP, have registered about $2.7 billion of investor outflows this month, according to investment bank Macquarie Group Ltd.

That...