"The 12 applicants have been granted bail. I will set further conditions on their bail later," High Court Judge Stephen Mubiru said at a televised court hearing.
Bail was set for each applicant at 5m Ugandan shillings (R19,100), payable if they fail to show up again in court.
Mubiru ordered the 12 accused to reappear in a lower court on Thursday for a mention of their cases, but also rejected a request from prosecutors to confiscate their passports.
Kyagulanyi, a popular musician, has composed songs whose biting criticism of Museveni's government have won him a large youth following.
Protesters and opposition supporters accuse Museveni, in power since 1986, of stifling dissent through intimidation, beatings and detentions, charges which his government denies.
Last October, when parliament was debating whether to remove a constitutional age limit that would have barred Museveni, now aged 74, from seeking re-election in 2021, security forces and protesters clashed on the streets and two protesters died. The presidential age limit has since been removed.