We know that a player can choose to give his inspiration to another player (PHB, p. 125, emphasis mine) :
[...] if you have inspiration, you can reward another player for good roleplaying, clever thinking, or simply doing something exciting in the game. When another player character does something that really contributes to the story in a fun and interesting way, you can give up your inspiration to give that character inspiration.
Yesterday, the group I'm DMing was in a tough fight and one character had to make a save vs a creature's breath. Another player, who had earned inspiration earlier due to good roleplaying decided to give him his inspiration, in order to grant him advantage on the saving throw.
I ruled that inspiration couldn't be awarded just because a player badly needs it, for that would open the door to abuse.
After a long argument, the players bent to my ruling, but I felt they weren't convinced at all.
Can a player really give his inspiration to another at any moment, even if the second player didn't earn the reward by doing something good, clever or exciting?
After consulting the entry about Inspiration in the DMG (p. 240-241), I still can't make up my mind. The section gives a lot of headroom for approaches and variants, but, in essence, it all comes down to the table following guidelines that have been agreed on collectively. In order to help the table set those guidelines, I need to know how important it is to earn inspiration by actively doing something.