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, when he stood before the assembled crowd to bring incense on the altar in honor of his new holiday.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 been viewed by the people as a legitimization of Yerovam's religious innovations.
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 the city 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 served to give it a prophetic stamp of approval.9
Why wasn't the נביא at the ceremony? T. Verdiger10 questions that according to R. Samet, it is difficult to understand why the prophet from Beit El was not present at the ceremony during the holiday, if he was so central to the religious upheaval. 11
The invitation
According to R. Samet, after the Man of God cast doubt on the legitimacy of the new worship during the dedication ceremony, the prophet from Beit El realized he needed to reaffirm his prophetic position (and thereby restore Beit El's religious status). By getting the Man of God to accept his word, he could assert himself as the more senior prophet, and "prove" that his stance towards the new worship was the correct one.
Prof. Simon, in contrast, assumes that the fate of the new religious system was less troubling to the old prophet than the prophecy regarding the burial plots, and it was mainly this which he wanted to prevent coming to fruition. He suggests that the act of undoing a prophetic sign was believed to actively affect the word of God that lay behind the sign.12 Thus, the prophet believed that if could reverse the decrees against eating etc. he could also undo the prophecy which lay behind them.
How was the man of God convinced? According to R"E Samet, it was the Man of God's status as true prophet and his sincere desire that the people repent that led him to believe the old prophet. When the prophet from Beit El told him that he had received word from Hashem allowing eating and drinking, he concluded that the people must have repented leading Hashem to rescind his decree against the city as a whole.13 As such, he saw no problem in accompanying the prophet from Beit El, and likely did so happily.
Harsh punishment – Though the Man of God did not act maliciously, his actions deserved punishment since they served to undermine his entire prophecy and had the potential to cause a huge desecration of Hashem's name. The supernatural nature of his death was needed to ensure that the people knew he was punished for his transgression.14 It sent a message that his eating and drinking in Beit El was not sanctioned by God and did not mean that Beit El was once again in God's favor.
Why does the נביא מבית אל 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.