It is in fact problematic to bury a righteous person next to a wicked one. When a Jew is non-observant, he can fall under the category of ‘tinok shenishbah’, (baby in captivity), (due to lack of positive exposure to the tenets of Judaism), and then he is no longer in the category of ‘wicked’.