If Logan was PG 13, it wouldn't have necessarily made more money because it would be a completely different movie.
Also, the previous two movies were considered terrible and quickly forgotten, while Logan was one of the most acclaimed movies of the year and got a Best Adapted Screenplay nom, which neither The Dark Knight nor Black Panther did.