SAN FRANCISCO—Tesla Inc. has filed a lawsuit to challenge Louisiana’s refusal to allow the company to sell vehicles directly to consumers, calling the U.S. state’s move protectionist and anti-competitive. The case is the latest battle to reverse direct sales bans in some states against the electric carmaker, which bypassed traditional car dealerships. In those states,…