WASHINGTON—President Donald Trump will bar transgender individuals from serving in the U.S. military, he said Wednesday, arguing their service brought “tremendous medical costs and disruption”—a conclusion at odds with a report commissioned by the Pentagon last year as part of a comprehensive policy review.

“After consultation with my generals and military experts, please be advised that the United States government will not accept or allow transgender individuals to serve in any capacity in the U.S. military,” Mr. Trump tweeted...