She went to find a doctor for the sick baby.

Literal

She [topic-は] sick baby [for-のために] doctor [object-を] search [purpose-に] went.

捜しに行った uses the purpose construction [verb-stem]+に+行く — 'went in order to search.' のために marks who the doctor is for.