I have read books about the American and French revolutions, but in all my reading it was never made clear why exactly Lafayette was imprisoned by the Austrians. It's clear that he angered the radical Jacobins in France, but it wasn't the Jacobins nor the French who imprisoned him. Wikipedia states that the Austrians feared he would lead Austrians to revolution given his participation in the American Revolutionary War. But it was a well-known fact that Lafayette was vastly more moderate than the French revolutionaries (Jacobins), so what did the Austrians fear exactly? And why not just deport him? Why a lengthy prison sentence?
Lafayette was a noble who had helped start the French Revolution, and had also participated in the American Revolution. Those facts made him a "revolutionary," (and a repeat offender) which counted for more than the fact that he was a moderate one. ("Degrees of badness" wasn't operative to Austrian royalists.)
He was imprisoned or detained, the Austrians believed, until a rightful French king could be restored to the throne, at which time he would be handed back to said king. The Austrians didn't believe or realize that it would be years until there was another French king (even one of non-royal birth like Napoleon Bonaparte), which is why Lafayette was detained for so long.