By default a curve object is placed as 3D curve. For this kind of curve, there is not better way ... only by adding more control points closer to angle keep lines thickness, but you will always deal with the issue at corners. Similar, but easier you result with curve converted to mesh object and using Skin modifier.
If your goal is 2D shape, than Robin Betts's answer is your way :)
It is happening because Blender calculates same profile shape at each control point.
(Here I converted a Curve to a Mesh just for visualisation purpose.)

To keep curve "thickness" consistent - profile has to be changed according to curve's segments angle ...

... sadly, that is not happening in Blender for 3D type curve.
Under Curve Properties you can change Mean Radius, but since you can't specify X/Y radius separately - the fix in one direction destroys profile in second direction ... so, it is useless as well ...

For this specific shape it is just better to convert into a mesh, Inset Face, Delete and Extrude (or add Solidify modifier).