Here's why:
* "It was a pleasure to meet with you" is a complete sentence that expresses your enjoyment of the meeting.
* "It meeting you" is grammatically incorrect and doesn't make sense. It's missing a verb and doesn't express a complete thought.
You could also use the shorter and equally correct phrase, "It was a pleasure meeting you." Both versions are perfectly acceptable ways to express your gratitude after a meeting.