I don’t know of any way to lock an axis for dynamics simulation, but you can cache the simulation and then use cappucino to convert the cache to keyframes, and then delete the Z position keyframes in order to limit movement to X and Y.
1) With the object’s Dynamics tag selected, go to Cache and click on “Bake Object.”

2) With the object selected, go to C4D’s main menu: Character > Manager > Cappucino to bring up the dialogue box below and confirm that Position and Rotation are selected (add Scale if you need it).

3) Click on “Start Realtime” and then with your cursor in the Viewport click and hold your mouse button until the animation runs through and all the keyframes are created. You will see the keyframes being created in the Viewport, and once you release the mouse button you will find all of the created keyframe parameters in the Timeline.
4) Open the Timeline menu, twirl open “Position,” and select and delete the Position . Z data.

5) Delete the Dynamics tag so that the position keyframes will be used.
For the camera, if you want it to match the X and Y position of your animated object while staying parallel to it in Z you could use the Set Driver/Set Driven expressions. Otherwise, a Target tag on it might be all that’s needed. Please elaborate more on what you want the final result to be and I will try to provide the best solution.