It is not an offense to photograph people, especially if they are just caught at the edge or out of the center of the photography. However you do not have a right to photograph people either. In fact, under German law, you have to gain the consent of people that are the centerpiece of a photo for publication, or make the photo for a number of enumerated reasons. Among such is news reporting or documenting an ongoing crime - such material is made in the public interest. If you make a photo without consent or qualified reason, possession of the photo in general is no problem but you have no right to publish the photo.
To prevent such publication, the photographed person may demand deletion or destruction of the photo - however, following the demand is not explicitly required. Such a demand however is equivalent to an explicit demand to not publish the picture. As such, it gets really tricky for the photographer. Publication without a release (or a no-release statement) or one of the few excusing reasons is a punishable offense, which can land you in prison for up to one year. This stems from Art. 2 GG, §22, §23 and §33 Kunsturhebergesetz.
Hindering rescue services with your camera and creating photos of injured and vulnerable people is illegal under the same reasoning. Getting into the way of the police can constitute obstruction of emergency helpers atop of that. More on that specific part of German law can be learned in this question. Do note that such photography can also be a crime under §201a StGB, especially if your photography shows someone as vulnerable.
Another possibility for the approaching police might have been, that the policeman was interested to find out if you might have photographed or filmed the incident that led to the arrest. In that case, he might have requested a copy for evidentiary reasons.