Simple: No piece of software is perfect and bugs should be expected. You charge for work at an hourly rate. A bug fix requires additional hours of work. Therefore you charge for fixing bugs.
Creating software is a creative process, and there is rarely an end point where the software is completely bug-free, or where there is absolutely no further improvement which can be made.
Bugs are like flubbed lines. They happen. They always happen. And coders get paid for fixing them.
If your doctor makes a mistake, does he give you a refund? Or does he charge both for the mistake and the new fix? Your lawyer?