When you stands on a carpet which is not touching the ground, and you are standing a gate that's closed, you can float above the carpet as long as you are standing on a carpet and you're y-axis haven't changed.
Note: Please ignore the "sneaking" in the second and third photo, for in mac you have to press shift to take a screenshot.
Thanks for the report! This is a duplicate of MC-1323, which has been closed as Working as Intended. This is not caused by the fence gate; rather, it is caused by the fence posts below the carpets.