Legislation allowing agency to monitor spread of COVID-19 clears first parliamentary vote 44-32, hours after ministers unanimously back it