A person carefully filters a drink to remove a gnat and then somehow swallows a camel. Jesus' image is intentionally absurd, and its humor makes the criticism memorable.
Both creatures were unclean under the Torah, but their enormous difference in size turns the saying into a picture of badly distorted priorities.