It doesn't matter in which direction the column is laterally deflected left or right. First you can adopt a convention that curvature is negative when the shape is concave with respect to the beam axis facing the beam, thus, for the pinned pinned case, curvature is negative for both left or right displacements . In answer to your question on moment signage when beam is deflected left or right for the pinned pinned case, when it deflects right, the applied eccentric moment is Py counterclockwise, and the internal moment M must be clockwise, thus
(-Py) + M = 0, or M = Py; and when it is deflected left , then the eccentric moment Py is clockwise and the internal moment M must be counterclockwise, thus (+Py) - M = 0, or M = Py, which is the same result, so again, it does not matter, and in both cases since M is - (EI)(d^2y/dx^2) , the the differential equation becomes
(EI)d^2y/dx^2 + Py = 0.