Why does CH3CH(OH)CH2CH3 give iodoform test?
The substrate you have provided (2-butanol) would indeed give a positive test.

The iodoform test is performed in presence of iodine and potassium or sodium hydroxide, which first oxidizes the aforesaid compound to 2-Butanone.

Mechanism (taken from this Wikipedia page) which shows $\ce{BrO-}$ instead of $\ce{IO-}$, but would be executed in a similar fashion:



Thus 2-Butanone responds to iodoform test successfully.



References:

Ueber Entstehung von Jodoform und Anwendung dieser Reaction in der chemischen Analyse, Lieben, Ann. Spl. Bd. 7, 218 1870