A U.S. District Judge has dismissed a lawsuit filed by Elon Musk's X, following an advertising boycott.