I think that the passage you are referring to is in John (maybe Matthew?) and what Jesus is adressing is the Pharisees, and basically what was happening was that they worshipped and followed the word of Moses and God's commandments very accuratley- Thou shalt not kill, thou shalt not commit adultery, etc. What Jesus was adressing was the fact that they were putting on a front- they were not holy, they were acting holy for everyone else to see. So thats the biblical background for it, but it definitley still stands, and basically what he was saying is that our intentions should be pure. So, I think the main point in the original question is simply the fact that you want to get credit for donating to charity. Not that you were serious, of course, but on a lesser scale, this same logic applies.
As for the "rules", I don't know exactly what you are referring to. I assume not the Ten Commandments, but various church rules and whatnot. I agree that many are silly, I'm a Catholic so I know a great deal about that. Of course some of them were man-made (so to speak) to account for various factors, such as the "no birth control" rule. The whole reason for that one was to increase the population of the Catholic church at a time when we didn't have many followers. But, of course, there are rules that I agree with and whatnot. I guess in the end what it comes down to is that nothing, including religion (or, mans interpretation of how to practice it) is perfect.