To attract "their" insects.
Almost all fragrant flowers are pollinated by insects. Plants benefit from pollinators visiting one of them and flying to another one of them.
Then the flowers will get pollen of their own kind, not someone else's. To this end, flowers have features that help insects recognize them: shape, coloration, and, naturally, smell. It can include substances that are attractive to the "right" pollinators.