This flashing’s improper installation is pervasive. Despite the fact that there are instructions on every bundle of shingles detailing this as an improper installation.
It must seem like a good deal to put the metal on the top. Maybe it seems like a good thing to cover the edge of the hand-cut shingles that, due to lack of experience, look like a rodent chewed on them.
No matter what the reasoning, putting edge metal on top of the shingles is always wrong. When rain is hitting and running down the top of the shingles, edge metal on top allows water to wick under the metal and access the wood rafter and sheathing. This condition will promote wood rot.
Unfortunately repair of this condition can become significant if the edge flashings have been in place for a few years. Ideally you should replace the shingles that were involved when the metal was nailed down. Although those holes could be filled, you would need to re-fill the holes every few years as the caulking/tar releases its grip. Depending on how long the flashing was installed incorrectly, there will also be sheathing and possibly rafter damage.
The repair of this issue is quickly approaching the exclusive realm of a professional contractor. Although I am a big fan of DIY sometimes the mark of a true craftsman is knowing when to sub out to a qualified professional.