Why perform bitwise operations here? (SPI FRAM read method)
Let's assume addr is 0xbeef. Then, if we break down each operation:

expression             │ value
───────────────────────┼───────
addr                   │ 0xbeef
addr &gt;&gt; 8              │ 0x00be
(uint8_t)(addr &gt;&gt; 8)   │   0xbe
addr &amp; 0xFF            │ 0x00ef
(uint8_t)(addr &amp; 0xFF) │   0xef


So this is essentially breaking down the address into two 8-bit chunks,
and transmitting those chunks individually. It's done like this because
SPI only transmits bytes.


  the casting is to keep sign extension from occurring.


Non, sign extension cannot occur, since addr is an unsigned number.
The casting really serves no useful purpose, other than documenting the
code. It would be done implicitly simply because SPItransfer() takes
an uint8_t argument. The casting could be useful if SPItransfer()
was overloaded with a 16-bit version.


  Finally, it always returns the same value x = 0, why?


No, it returns whatever the call to SPItransfer(0); returns, i.e. the
data sent by the FRAM module.