Rendering background separately

I’m using URP with post processing for my levels and I don’t want it to affect the background color. I tried achieving this effect by creating an overlay camera for the background image but then transparency doesn’t work because the background image is drawn on top of all the transparent objects. Is there any way to achieve this effect?

I think you can achieve this using a custom render feature. This can be enabled and adjusted in the pipeline asset. There you can choose when the object is drawn. In your case setting the event to AfterPostProcessing might do the trick.
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/containers/create-custom-renderer-feature-1.html

As mentioned in this thread, camera stacking with separate post-processing is not possible because the color buffer that has been post-processed loses its alpha information.

You will need to implement a full-screen renderer feature that saves the alpha values of the color buffer just before post-processing and blends the color buffer with the background image after post-processing by referencing the saved alpha values.