Data-mining software firm Palantir Technologies Inc. prevailed in a lawsuit against the U.S. Army that means the company could be eligible for a $200 million contract.

A federal judge in the U.S. Court of Federal Claims issued an oral ruling in the case Monday, siding with Palantir in its contention that the Army didn’t comply with a 1994 law that requires government agencies to research commercially available products before trying to build what they need from scratch.

Companies...