Because English is weird and unpredictable.
You can use punctuation to make it more obvious, or choose different ways of saying things to avoid the ambiguity, but ambiguity like that is not considered wrong per se. It is often considered bad writing, though occasionally it's the least-bad way to do it.
Ideally, a phrase appears as close to what it is modifying as possible, but that can be a long way away, sometimes. In your first example, there's no semantic reason to think that the adverb phrase of purpose applies to any verb other than the one it is immediately after - it is closer, and you are more likely to use something to measure growth rather than learn it to measure growth. After all, how would learning measure anything?
In your second example, scarcely used can be adjective phrase, rather than a verb, all on its own - but it could be modified by the adverbial of purpose to generate profit, meaning it's is "scarcely used to generate profit". Of course, the principal verb employed could also be modified by that adverbial of purpose. Even without the 'scarcely' you would have this ambiguity; is this a strategy that is used, in general, to generate profit, or is it a strategy that is used, and you're using it to generate profit? Semantics in that case would say it should be read as modifying used, because simply saying a strategy "is used" as a general statement would be weird.
However, you can make "scarcely used" into a more definite adjective and put it in a different place, and the ambiguity goes away:
We employed a scarcely-used strategy to generate profit.
It's clunkier, but you can also remove the ambiguity with commas - and that can work either way. I've also thrown in an extra word that is optional but helps readability:
We employed a strategy, one that is scarcely used, to generate profit.
We employed a strategy, one that is scarcely used to generate profit.