Videos shared on social media showed the men being hugged and garlanded by supporters.
NDTV reports all the men are accused of inciting violence in Bulandshahr last December after carcasses of 25 cows were found in a forest in the area.
Police inspector Subodh Kumar Singh and 20-year-old Sumit Kumar were shot dead in the riot that broke out on December 3, 2018.
Shikhar Agarwal, who used to head the local BJP youth wing, was one of the accused granted bail. The others are Rajiv, Rohit, Raghav, Jitendra Malik, Rajkumar and Sourav, Indian Express reports.
Police told the Express that lawyers of the accused had argued for bail saying they did not have a prior criminal record and were not prone to committing a crime if they got bail.
A chargesheet against 38 accused was filed on March 2 in which five people were charged with the murder of the Inspector. Shikhar Agarwal and Upendra Raghav were among those accused of inciting violence and arson.