Sometimes people act good for bad reasons like the ones who give money to homeless recording it for YouTube, acting bad for good reasons, killing or being killed in some cases etc.
The intention could be good or bad, but the action is not necessary as the intention. You could have the better intentions and doing the worst things. Or having bad intentions but finally do it good. When the action is good, does it mean it was the objective at the beginning ? This action is maybe the result of others. But maybe at the beginning it was something different...
For example, someone stealing a car, there's a baby in it, he lets the baby somewhere people would find it real quick, it's a good action, but he didn't plan this and he did steal a car. But this good action wouldn't have been possible without the bad one. And the owner of the car didn't steal anything but letting a baby in a car solo is rather a bad action. And here his bad action leads to another one then to a good one. No rules
EDIT :
Yes, some bad actions don't mean you're a bad person, but sometimes some people are not bad for their actions, for nothing concrete in fact, no facts, just a negative attitude, contempt