Trimco 1298 626 Door Stop 4-3/16" Projection - Satin Chrome
A reason to install it onto the wall is so that you keep it off the door and prevent it from being a tripping hazard.
A reason for installing it on the door might be that you have out swinging doors on a patio that are sitting perhaps 8” above the deck surface and you have a seal and then a step down and so that when the doors open to 90° or 180° you would mount it on the door so that it makes contact with the wall because placing it otherwise on the wall may not permit the door to make contact with the stopping hardware.