​Painters often use spackle and wood putty to create a perfect finish area before they start to paint. If the drywall of a room has holes where pictures were hung, or other blemishes the painter knows that without repairing these damages their paint job will not look as smooth or appealing.
They use spackle and fill in these holes then sand the spackle so that it is smooth and does not have a ridge where it has been applied. After they paint the wall the spackle is not noticeable and the wall looks like it is without blemish or defect.
If they are painting a wooden surface the painter will use wood putty in much the same manner as he uses spackle on drywall surfaces.