Recently, I had to go through all the steps and associated expenses to evict a tenant. Now I was surprised by an e-mail from a housing association, asking for a tenant reference as the person in question has applied to go on their register.

Apart from the fact that I have never done this before the main problem is how to write this reference? Assuming that the law sides, as per usual, with the tenant I suppose I cannot write the truth. But what am I allowed to write with such a negative history? Do I just state ABC lived at XYZ. The monhtly rent was ... - and be done with it?

Any advice will be much appreciated.

As I understand, isn't it illegal to give a bad reference ?
I would consider these approaches for myself but take legal advice first.

1) MUST you respond at all given that the ex-Tenant may not have given you any authority.
You can claim data protection and so under no obligation to respond to the Association - ever ?
Be ready for a cold-call and bat them off with data protection.

2) Could you email the Tenant & Association (same email), telling the Tenant that the Association wish a Reference and asking him if this is valid email address and for him to give permission AND ask the question:
"What FACTs would you like me to reveal to this association and what FACTS am I not allowed to discuss ?"
That way you are not giving a Bad reference but letting the Association know you are being gagged.

It might be over the top to include....
"You might consider to REPLY ALL so that the Association can see what limitations you have placed on me to save them asking those questions"

My understanding is that you would breach the DPA IF you posted info about a bad tenant on a forum or made, unsolicited, other landlords or letting agents aware that the tenant was a poor one (e.g because of arrears, damage to property etc.). But you are able to be truthful when the tenant has given your name as a previous landlord in the knowledge it will be used for a reference.
Bear in mind, I think people now have the right to ask to see references concerning them. That said, i'd have no hesitation saying a tenant was problematic if i had had a bad experience with them. Or you could refuse point blank a reference for someone citing a poor experience.