The spout needs to touch the wall in order to seal. If you have a single handle faucet the escutcheon may have gotten tightened so much it has pulled the valve body forward bringing the spout with it.
Or, if you have threaded nipples then you may need a different system as they only come in 1/2″ lengths. You can get a nose spout which will allow you to use a coupling to make up the 1/4″ of room.
If you can’t fix it yourself you should call a plumber because spouts not sealing to the wall ruins the wall and the ceiling below if there is one.