Have finished this amazing game, but didn't ever understood, what paint baskets were for? Was meeting them in various worlds with no direct purpose...
According to this walkthrough:
These small items allow you to make your mark on the world by painting your own QR code on the walls. The messages you leave can be seen by any other player that is on your friends list, so make things interesting by hiding them in obscure areas. Of note, the paint bucket is the only item in the world that can pass through the purple puzzle gates.
So its purpose is to leave messages around for your friends to find.
There are also 2 achievements related to paint buckets:
Leave Your Mark: Unlocked after using a paint bucket to write a QR message for the first time.
Split Personality: Find the paintbuck in a level that has a recorder puzzle. Bring the paintbucket into the puzzle and start the recording. During this time, paint a QR code and then stop the recording. During playback, read the ghost QR code to obtain the achievement.