Detained in police station for traffic offence

I was stopped by police officers who shockingly did an alcohol test on me. The results were positive and I got arrested and spent the night in police custody. Can they arrest me for this offence? Could they just not have fined me and let me go? Is this legal?
TT, Dar

The Road Traffic Act states that any person required to provide a specimen of blood for a laboratory test pursuant to the provisions of this Act may thereafter be detained at a police station until it appears to a police officer that the proportion of alcohol in the person’s blood does not exceed the prescribed limit. For the purposes of this Act, the expression “prescribed limit” means eighty milligrams of alcohol in one hundred millilitres of blood.

You can see that your arrest was legal to also protect you. There is nothing shocking about alcohol tests- they are now quite common in Dar.