Hello,
please open Terminal.app and run following commands:
sudo rm -rf "/Library/Application Support/Avast"
sudo rm -rf "/Applications/Avast.app"
after this you should be able to install Avast again. If it still does not work try to reboot your Mac.
Best regards,
Jakub