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 refusal to partake in a meal in Beit El symbolized the total rejection of the city, and moreover, that such rejection began already in the present (even if the full prophecy was only to be fulfilled in the future).4
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.5 Thus, had the prophet returned the way he had come it would have been viewed as a reversal of his mission and decree.6 R. Samet adds that going via a new path signifies the opposite, that "דבר ה' אחור לא ישוב ריקם".7
הנביא מבית אל: True or false prophet? According to this approach, the prophet from Beit El was a false prophet.8 R. Samet suggests, moreover, that he was closely connected to Yerovam's new religious enterprise and gave it a prophetic stamp of approval.9
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.