If it reached you via bot trade, then it should be obvious why it reset friendship when reaching you. The middleman (bot) has to have a friendship value. When it trades to you, you become the newest handler, and the previous handler's friendship is overwritten with the new friendship value for you, which is the default friendship minimum on trade.
How to fix it? Either be the OT of the Pokemon, or inject it directly to your save file without a bot. Or raise the friendship after receiving it, like everyone else who isn't cheating.