score:2
I don't know about Malang, but here in Jakarta, as long as they are wearing their blue shirt, it means they are employed by government. Lately they also receive wage from the government. If you want to ensure that the cash you give goes to the government, ask for the retribution ticket (karcis)
However if they are not wearing any official attribute, usually they are self-employed. The legality of it depends on the private space owner, but usually the owner just lets them do it. You have to give some money to them, since it has become the norm.
Upvote:3
Might depend on where you are, but in general most are legal. From the amounts mentioned (3000), it seems you are either in Jakarta or a tourist destination.
Anyway, everybody pays them, and as a foreigner, you definitely are a rich person (I know people who have to work 6 days a week and earn less than 100$ per month). So it would be at least rude not to pay.
Source: been there, asked the same question to my local friends (and know someone who works as tukang parkir).