The Prophet from Beit El hoped that by having the Man of God disobey his own words and prophetic sign, he could undo the prophecy against Beit El (and restore legitimacy to the worship taking place there.)
Timing of the incident – R"E Samet suggests that our chapter is a direct continuation of Chapter 12 and takes place towards the beginning of Yerovam's reign, on the new holiday he had declared, when he stood before the assembled crowd to bring incense on the altar.2
Miracles of the Man of God
Yerovam's invitation – R. Samet suggests that Yerovam was hoping that if the prophet acquiesced to eat by him, it would be taken as a sign that, despite the devastating prophecy, the Man of God did not view the city of Beit El and its king as reprehensible. A public, positive response from the prophet3 would have provided much needed legitimacy to Yerovam's religious upheaval.
Prohibition of eating and drinking in Beit El – It was for this very reason that Hashem prohibited the Man of God from eating or drinking in Beit El. The refuals to partake in ameal in Biet el eyomboklized its total rejection
Prohibition of returning via the same path – Prof. Simon suggests that returning to one's point of departure and retracing one's footsteps signify a cancelling of the journey.4 Had the prophet returned the way he had come it could be viewed as a reversal of his mission and decree.
הנביא מבית אל: True or false prophet?
Why wasn't the נביא at the ceremony?
How was the man of God convinced?
Harsh punishment
Why does the navi get the prophecy?
חוטא נשכר?
Test of Prophet
The Prophet from Beit El did not know if the Man of God was a legitimate prophet or an emissary sent by Rechovam to attack Beit El for political reasons. His invitation was intended to discover whether or not he truly spoke the word of Hashem.
הנביא מבית אל: True or false prophet? According to these sources, the prophet from Beit El was atrue prophet
Act of Altruism
The prophet's motives were misguided, but altruistic. He simply wanted to prevent the Man of God from going home hungry.
Sources:Abarbanel
Personal Gain
The prophet from Beit El aimed to protect his prophetic business and standing with the king / hoped to sway the Man of God to defect to Beit El and work with him in his prophetic business.