It is true that the Prophet ﷺ did this, but this was specific for the Prophet ﷺ alone.
مَرَّ النَّبِيُّ صلى الله عليه وسلم بِحَائِطٍ مِنْ حِيطَانِ الْمَدِينَةِ أَوْ مَكَّةَ، فَسَمِعَ صَوْتَ إِنْسَانَيْنِ يُعَذَّبَانِ فِي قُبُورِهِمَا، فَقَالَ النَّبِيُّ صلى الله عليه وسلم " يُعَذَّبَانِ، وَمَا يُعَذَّبَانِ فِي كَبِيرٍ "، ثُمَّ قَالَ " بَلَى، كَانَ أَحَدُهُمَا لاَ يَسْتَتِرُ مِنْ بَوْلِهِ، وَكَانَ الآخَرُ يَمْشِي بِالنَّمِيمَةِ ". ثُمَّ دَعَا بِجَرِيدَةٍ فَكَسَرَهَا كِسْرَتَيْنِ، فَوَضَعَ عَلَى كُلِّ قَبْرٍ مِنْهُمَا كِسْرَةً. فَقِيلَ لَهُ يَا رَسُولَ اللَّهِ لِمَ فَعَلْتَ هَذَا قَالَ " لَعَلَّهُ أَنْ يُخَفَّفَ عَنْهُمَا مَا لَمْ تَيْبَسَا أَوْ إِلَى أَنْ يَيْبَسَا "
Once the Prophet, while passing through one of the graveyards of Medina or Mecca heard the voices of two persons who were being tortured in their graves. The Prophet (ﷺ) said, "These two persons are being tortured not for a major sin (to avoid)." The Prophet (ﷺ) then added, "Yes! (they are being tortured for a major sin). Indeed, one of them never saved himself from being soiled with his urine while the other used to go about with calumnies (to make enmity between friends). The Prophet (ﷺ) then asked for a green leaf of a date-palm tree, broke it into two pieces and put one on each grave. On being asked why he had done so, he replied, "I hope that their torture might be lessened, till these get dried."
And it is important to note that this is a point of difference among scholars, so you have some saying that it is recommended and some that is not. The most correct is that this was specific to the Prophet ﷺ only, and that he ﷺ did it as intercession from him.
إِنِّي مَرَرْتُ بِقَبْرَيْنِ يُعَذَّبَانِ فَأَحْبَبْتُ بِشَفَاعَتِي أَنْ يُرَفَّهَ عَنْهُمَا مَا دَامَ الْغُصْنَانِ رَطْبَيْنِ
I passed by two graves the occupants of which had been undergoing torment. I liked to make intercession for them so that they might be relieved of this torment as long as these twigs remain fresh
This (Arabic)This (Arabic) is available for more information.
It is not necessarily an innovation (at least I wouldn't call it such), but it was done from the Prophet ﷺ as benefit for the two in the grave, but this as I said was specific to the Prophet himself ﷺ. So we/those who are alive are highly recommended to do that which would benefit the dead as is in the Shariah, like Sadaqah and Dua'.