In Barcelona, and generally in Spain, you are required to tap your card only when you board the bus, not when you get off. If you fail to tap when boarding, you may be fined if caught by inspectors, as riding without a valid ticket is against the rules.