Kainerugaba replaces Wilson Mbasu Mbadi, who was removed and appointed as a junior minister, the ministry said.
In 2022, Kainerugaba was removed by his father from his post where he was the commander of Uganda's land forces after he made threats to invade neighboring Kenya in posts on social media platform X, formerly Twitter.
In his posts, the 48-year-old military official also expressed support for Russia's President Vladimir Putin saying, "the majority of mankind (that are non-white) support Russia's stand in Ukraine."
Kainerugaba has long been viewed as being prepared to take over the presidency from his father, who has ruled the East African nation for nearly 40 years.
Although Ugandan laws bar serving military officers from involvement in politics, Kainerugaba frequently trades barbs with opposition politicians. He has also formed a pressure group that has been mobilizing political support for him, drawing criticism from his critics and the opposition.
Uganda is due to hold its next presidential election in early 2026 and Museveni is widely expected to seek re-election.