Some problems are such that a greedy solution will actually be optimal, and sometimes they're engineered that way.
A fun example is that many countries' coin values are such that a greedy approach to returning change (i.e. always returning the largest-possible coin until you're done) works.