Palantir beat earnings expectations with strong U.S. government and commercial growth, highlighting AI-driven expansion and solid cash flow.