There is nothing that prevents this - out to 60 feet
Bardic Inspiration says:
You can inspire others through stirring words or music. To do so, you use a bonus action on your turn to choose one creature other than yourself within 60 feet of you who can hear you.
The requirements of giving inspiration are that the target must be within 60 feet of you and must be able to hear your words.
Message says:
You point your finger toward a creature within range and whisper a message. The target (and only the target) hears the message and can reply in a whisper that only you can hear.
This is the effect of the message spell: the message can be heard by the target, and what the target hears is your (stirring) words, fulfilling the requirement of giving inspiration.
Some people are concerned with whether the words that are part of the bardic inspiration bonus action can be produced by the main action of spellcasting - as SeriousBri puts it, "message delivers a message, not a class feature." But as long as the message includes words, they can be your stirring words that the target hears and thus they fulfill the requirements for bardic inspiration. It is not the action of casting message that conveys the inspiration, but once the spell is cast, the spell effect meets the requirements for using your bonus action to grant inspiration.
An action economy objection, that you can't use a bonus action as a part of a main action like casting message, also does not hold up.
The casting time of message is 1 action, but its duration is one round. Thus, you can cast the spell as your action and still have until the start of your next turn to whisper the message (producing the spell effect). Normally you can take bonus actions only on your own turn, but there is nothing preventing you from completing the action of casting the spell and then before your turn ends activating the spell effect by whispering and through the whisper granting the bardic inspiration.
But it is very seldom that this would help
One question is whether you can do this, and RAW clearly you can. But another question is whether you would ever want to, and here the answer is typically not. Basically you are using an action and a bonus action to accomplish what could be accomplished with a bonus action alone, and thus 'wasting' your action, which is not smart action economy.
Message will not improve the range of your ability: the range of message is 120 feet, but bardic inspiration requires that your target be within sixty feet of you, not within sixty feet of where it hears your voice coming from. You can send the message 120 feet, but the inspirational power of the stirring words will run out after the first sixty.
Message does not make your action more stealthy: since only the target can hear your message, you might want to use this in a covert situation, being able to whisper your stirring words rather that singing them loudly. However, you still have to cast the message spell, which has a Verbal component independent of the spell effect of the message itself, since they are not the same. Jorn's point is well-taken; if your goal is to be stealthy, the act of casting the spell will be audible to all, just as much as your stirring words produced normally would have been.
Further note that the duration of bardic inspiration is ten minutes. If stealth is part of your plan, simply grant inspiration to your target before your foes are on hand to hear you do it.
So while you can use message to convey inspiration, why would you? In most situations you could simply use your bonus action to speak words of encouragement anyway, and reserve your main action for doing something more useful then replicating an effect you can already produce.
That's not to say there couldn't be niche cases and unforeseen circumstances in which this trick might be useful. Suppose you are in a narrow corridor and an enemy in the room ahead drops silence in the middle of your party, centered on your mage. Your ally already in the room goes after you in the turn order, and you would like them to start their turn with inspiration, but you are on opposite sides of the silence effect and they will not be able to hear your stirring words, nor do you have enough move to cross the entire forty feet diameter of the silence. Yet your ally is still within sixty feet of you, so you could use message to get your stirring words to them across the void of the silence. One can contrive scenarios in which using message might make sense as a vehicle to convey inspiration, an adaptive response to strange circumstances, but it is unlikely to be part of your covert plan.