Kizza Besigye, 66, was detained after he led a protest against in downtown Kampala, the capital, only days after he was freed from jail, where he had spent nearly two weeks on similar charges.
On Tuesday, he was charged with "incitement to violence" for his alleged role in galvanising protests against high prices, which authorities say were held without permission.
Chaos erupted in court when his supporters shouted "shame on you" at the magistrate, who declined pleas from Besigye's lawyers to release their client on bail.
Besigye has been calling for tax cuts to offset inflation, but Museveni has refused relief, blaming high prices for items such as cooking oil, fuel and wheat on the war in Ukraine and the COVID-19 pandemic.
Besigye has been detained dozens of times and lost four elections to Museveni, 77, although he alleges intimidation and vote-rigging.