There’s a quick test you can try to see if it wants your attention. Instead of approaching from the inside, attempt to approach it from outside if you can. It may still fly away, but if so, keep an eye on it. If it looks back at you while it’s flying, follow it, as that’s a very good indicator that it needs your help. If it stays and studies you, that’s also a good indicator. Approach slowly with your hands visible until it’s comfortable enough to show you what it wants. If it flies away without looking back, if approaching it from the outside isn’t an option for you, or if it outright attacks you, keep reading.
If it doesn’t want help (as indicated by the last option above), then it’s most likely confused or bored, rather than angered by its reflection. At the very least, it probably sees its own reflection as another spearow, and it’s trying to investigate. (Spearow are actually highly social within their own flocks, and unless a spearow is obviously a member of a flock from a territory bordering their own, they will generally attempt to befriend other spearow and draw them into their folds.) At most, though, it’s likely that its reflection simply entertains it. Alternatively, it could be attracted to something inside your home or to a reflection of part of the branch, if it’s pecking low.
All of these situations can be resolved rather easily with a little bit of work on your part. One thing you should do is ensure that anything that could be of interest to a spearow (indoor plants, art pieces that resemble insects, and so forth) are moved away from the window. After that, apply vertical strips of tape, a cheap window film, or even window paint to break up or obscure most of the surface area. If this still doesn’t help, draw the blinds or curtains. While this won’t necessarily disrupt the spearow’s reflection, it can at least minimize the number of things that could be attracting it and show it that it’s only looking at a window, rather than another spearow.
If all else fails, however, you may wish to consider catching it or adopting a good electric type. (Word of warning: Don’t use a pikachu.)
Best of luck!