She finally picked up the bad habit of smoking.

Literal

She [topic-は] finally smoking [called-という] bad habit [subject-が] attached.

~という here is the defining/identifying frame, attaching a label or category to a noun: 喫煙という習慣 ('a habit called smoking,' i.e. 'the habit of smoking'). Common in expository writing for naming a concept before describing it. 習慣がつく ('a habit forms / sticks') uses つく ('attach, stick') intransitively — the habit attaches itself to the person, rather than the person actively forming it. Pair this with 習慣をつける (transitive, 'develop a habit deliberately') to see the agent-flexibility of つく/つける. ついに paired with 悪い ('bad') gives the sentence a slightly resigned tone — as if the speaker had been watching this happen and isn't surprised.