you didn't have to; you shouldn't have
No tenías que haber revelado el secreto.
You shouldn't have revealed the secret.
You weren’t supposed to go there.
You didn't have to do that.
No tenías que venir a la oficina hoy.
You didn't have to come to the office today.
You didn't have to take a taxi.
No tenías que acabar temprano.
You didn't have to finish early.
You didn't have to do this.