This is because anti bacterial medicines block the formation of cell wall of the bacteria. When, bacterias dont have cell wall, they dont divide and hence they die. While, viruses dont have their machinery of own. When they enter into our body, they use our cells as their machinery. So, to kill viruses we've to kill some of our cells as well.
Hence, making anti-viral drugs is more difficult than making anti-bacterial drugs