All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
Graveyards are of great sanctity and Muslims must show respect to their inhabitants. Therefore, the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, banned Muslims from walking between the graves wearing shoes. Basheer, the freed slave of the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, narrated that he, sallallaahu ‘alayhi wa sallam, saw a man walking between the graves while wearing shoes. So, he, sallallaahu ‘alayhi wa sallam, said: "O you wearing the shoes (with hair)! Woe to you! Take off your shoes." When the man recognized that the speaker was the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, he took them off and threw them. [Abu Daawood]
He, sallallaahu ‘alayhi wa sallam, also forbade sitting on graves. Abu Hurayrah narrated that the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, said: "It is much better for one of you to sit on a burning coal, which will burn his clothes and get to his skin than to sit on a grave." [Ahmad, Muslim, Abu Daawood and others].
There is no doubt that playing football near graves and the possible consequences (i.e. the ball falling into the graveyard and then some of the players bringing it back) are considered a violation to the sanctity of graveyards.
Therefore, we advise the questioner and his friends to avoid playing football near the graveyards so as not to violate its sanctity.
Allaah Knows best.