I don't know if it is something that is suppose to happen but if you take string and place it on the ground and then you can place carpet on top of the string you can also do it with Redstone. Also you can use water to wash out the Redstone or string that under the carpet and the carpet will still float there without popping off until the water disappears from underneath it. So as long as there is water under the carpet it will just float.
Recreate
1) place Redstone or string on the ground
2)place carpet on top of it
(Possible)
3)place water to wash out Redstone or string and the carpet will float there until water is gone from underneath it.
Related issues
Comments

Working as intended. Items such as redstone, string, and carpets are technically full blocks so placing one down then the other will put the second item in the next block space. The only block that can have two blocks occupying the same space are half slabs.
The water part thoug, I don't believe should happen. this may be a bug